单元测试
#you do not need the following line if you are using
#the ngx_openresty bundle:
lua_package_path "/path/to/lua-resty-redis/lib/?.lua;;";
server {
location /test {
content_by_lua_file test_case_lua/unit/test_example.lua;
}
}local iresty_test = require("resty.iresty_test")
local tb = iresty_test.new({unit_name="example"})
function tb:init()
self:log("init complete")
end
function tb:test_00001()
error("invalid input")
end
function tb:atest_00002()
self:log("never be called")
end
function tb:test_00003()
self:log("ok")
end
-- units test
tb:run()Last updated