示例工程 21-coroutines

21-coroutines/02-generator/_test.lua

lua · 0.2 KB

-- @runtimes lua54 luajit
local h = require("harness")
local m = require("main")
h.describe("wrap 生成器", function()
	h.it("1..4 累计", function()
		local r = m.run(function() end)
		h.eq(r.sum, 10)
		h.eq(r.count, 4)
	end)
end)
h.run()