示例工程 20-error-handling

20-error-handling/01-error-levels/_test.lua

lua · 0.3 KB

-- @runtimes lua54 luajit
local h = require("harness")
local m = require("main")
h.describe("error level", function()
	h.it("0 无位置,2 指向调用者", function()
		local r = m.run(function() end)
		h.eq(r.zero, "boom")
		h.truthy(r.two ~= "boom")
		h.truthy(r.two:find("main.lua", 1, true) ~= nil, r.two)
	end)
end)
h.run()