示例工程 21-coroutines

21-coroutines/01-producer-consumer/_test.lua

lua · 0.3 KB

-- @runtimes lua54 luajit
local h = require("harness")
local m = require("main")
h.describe("生产者消费者", function()
	h.it("依次取值与最终返回", function()
		local r = m.run(function() end)
		h.eq(r.values, { 10, 20, 30 })
		h.eq(r.final, "done")
	end)
end)
h.run()