Skip to content

Commit 33497e3

Browse files
committed
test: added test case.
1 parent 2c1eebe commit 33497e3

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

t/sanity.t

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,3 +342,41 @@ metadata /aa
342342
nil
343343
nil
344344
nil
345+
346+
347+
348+
=== TEST 10: Iterator
349+
--- config
350+
location /t {
351+
content_by_lua_block {
352+
local radix = require("resty.radixtree")
353+
local rx = radix.new({
354+
{
355+
path = "/*",
356+
metadata = "metadata /*",
357+
},
358+
{
359+
path = "/aa/*",
360+
metadata = "metadata /aa",
361+
},
362+
{
363+
path = "/bb/*",
364+
method = {"PUT"},
365+
metadata = "metadata /bb/*",
366+
},
367+
{
368+
path = "/bb/aa/*",
369+
method = {"PUT"},
370+
metadata = "metadata /bb/aa/*",
371+
},
372+
})
373+
374+
ngx.say(rx:match("/bb/aa/bb"))
375+
}
376+
}
377+
--- request
378+
GET /t
379+
--- no_error_log
380+
[error]
381+
--- response_body
382+
metadata /*

0 commit comments

Comments
 (0)