示例工程 12-iterators

12-iterators/02-closure-iterator/_test.lua

lua · 0.2 KB

-- @runtimes lua54 luajit
local h = require("harness")
local m = require("main")
h.describe("闭包迭代器", function()
	h.it("累计 1..5", function()
		local r = m.run(function() end)
		h.eq(r.sum, 15)
		h.eq(r.count, 5)
	end)
end)
h.run()