示例工程 10-pattern-matching

10-pattern-matching/05-gsub-count/_test.lua

lua · 0.3 KB

-- @runtimes lua54 luajit
local h = require("harness")
local m = require("main")
h.describe("gsub 计数", function()
	h.it("返回替换次数", function()
		local r = m.run(function() end)
		h.eq(r.replaced, "a* b2 c*")
		h.eq(r.count, 3)
	end)
end)
h.run()