示例工程 27-debugging-and-observability

27-debugging-and-observability/02-getinfo-caller/_test.lua

lua · 0.3 KB

-- @runtimes lua54 luajit
local h = require("harness")
local m = require("main")
h.describe("getinfo", function()
	h.it("返回调用位置", function()
		local r = m.run(function() end)
		h.truthy(r.location:find("main", 1, true) ~= nil or r.location:find(":", 1, true) ~= nil)
	end)
end)
h.run()