示例工程 35-plugin-system

35-plugin-system/03-timeout-hook/_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.ok, false)
		h.truthy(r.message:find("plugin timeout", 1, true) ~= nil)
	end)
end)
h.run()