Skip to content

Commit e2dc750

Browse files
committed
feat: revert indent
1 parent 782f9dd commit e2dc750

File tree

1 file changed

+48
-48
lines changed

1 file changed

+48
-48
lines changed

t/core/schema_def.t

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -255,65 +255,65 @@ passed
255255
256256
=== TEST 5: validate IPv6 address format in upstream nodes
257257
--- config
258-
location /t {
259-
content_by_lua_block {
260-
local schema_def = require("apisix.schema_def")
261-
local core = require("apisix.core")
262-
local upstream = require("apisix.upstream")
263-
local t = require("lib.test_admin")
264-
-- Test valid IPv6 addresses (enclosed in brackets)
265-
local valid_cases = {
266-
{
267-
nodes = {
268-
{host = "[::1]", port = 80, weight = 1},
269-
},
270-
type = "roundrobin"
258+
location /t {
259+
content_by_lua_block {
260+
local schema_def = require("apisix.schema_def")
261+
local core = require("apisix.core")
262+
local upstream = require("apisix.upstream")
263+
local t = require("lib.test_admin")
264+
-- Test valid IPv6 addresses (enclosed in brackets)
265+
local valid_cases = {
266+
{
267+
nodes = {
268+
{host = "[::1]", port = 80, weight = 1},
271269
},
272-
{
273-
nodes = {
274-
{host = "[2001:db8::1]", port = 80, weight = 1},
275-
},
276-
type = "roundrobin"
277-
}
270+
type = "roundrobin"
271+
},
272+
{
273+
nodes = {
274+
{host = "[2001:db8::1]", port = 80, weight = 1},
275+
},
276+
type = "roundrobin"
278277
}
278+
}
279279
280-
for _, ups in ipairs(valid_cases) do
281-
local ok, err = upstream.check_schema(ups)
282-
if not ok then
283-
ngx.log(ngx.ERR, "Expected valid case failed: ", err)
284-
end
285-
assert(ok, "Valid IPv6 case should pass: " .. (err or ""))
280+
for _, ups in ipairs(valid_cases) do
281+
local ok, err = upstream.check_schema(ups)
282+
if not ok then
283+
ngx.log(ngx.ERR, "Expected valid case failed: ", err)
286284
end
285+
assert(ok, "Valid IPv6 case should pass: " .. (err or ""))
286+
end
287287
288-
-- Test invalid IPv6 addresses (not enclosed in brackets)
289-
local invalid_cases = {
290-
{
291-
nodes = {
292-
{host = "::1", port = 80, weight = 1},
293-
},
294-
type = "roundrobin"
288+
-- Test invalid IPv6 addresses (not enclosed in brackets)
289+
local invalid_cases = {
290+
{
291+
nodes = {
292+
{host = "::1", port = 80, weight = 1},
295293
},
296-
{
297-
nodes = {
298-
{host = "2001:db8::1", port = 80, weight = 1},
299-
},
300-
type = "roundrobin"
301-
}
294+
type = "roundrobin"
295+
},
296+
{
297+
nodes = {
298+
{host = "2001:db8::1", port = 80, weight = 1},
299+
},
300+
type = "roundrobin"
302301
}
302+
}
303303
304-
for i, ups in ipairs(invalid_cases) do
305-
local ok, err = upstream.check_schema(ups)
306-
if ok then
307-
ngx.log(ngx.ERR, "Expected invalid case passed: ", i)
308-
end
309-
assert(not ok, "Invalid IPv6 case should fail")
310-
assert(string.find(err, "IPv6 address must be enclosed with '%[' and '%]'"),
311-
"Error should mention IPv6 enclosure requirement")
304+
for i, ups in ipairs(invalid_cases) do
305+
local ok, err = upstream.check_schema(ups)
306+
if ok then
307+
ngx.log(ngx.ERR, "Expected invalid case passed: ", i)
312308
end
309+
assert(not ok, "Invalid IPv6 case should fail")
310+
assert(string.find(err, "IPv6 address must be enclosed with '%[' and '%]'"),
311+
"Error should mention IPv6 enclosure requirement")
312+
end
313313
314-
ngx.say("passed")
315-
}
314+
ngx.say("passed")
316315
}
316+
}
317317
--- response_body
318318
passed
319319

0 commit comments

Comments
 (0)