示例工程 20-error-handling

20-error-handling/03-xpcall-traceback/_test.lua

lua · 0.3 KB

-- @runtimes lua54 luajit
local h = require("harness")
local m = require("main")
h.describe("xpcall traceback", function()
	h.it("保留 stack traceback", function()
		local r = m.run(function() end)
		h.eq(r.ok, false)
		h.eq(r.has_traceback, true)
	end)
end)
h.run()