示例工程 32-openresty-and-redis
32-openresty-and-redis/03-redis-rate-limit/_test.lua
-- @runtimes lua54
local h = require("harness")
local m = require("main")
h.describe("Redis 限流", function()
h.it("固定窗口前两次通过", function()
local r = m.run(function() end)
h.eq(r.first, true)
h.eq(r.second, true)
h.eq(r.third, false)
end)
end)
h.run()