示例工程 14-metatables-and-operators

14-metatables-and-operators/03-len-metamethod/_test.lua

lua · 0.2 KB

-- @runtimes lua54
local h = require("harness")
local m = require("main")
h.describe("__len", function()
	h.it("覆盖 # 结果", function()
		local r = m.run(function() end)
		h.eq(r.length, 30)
		h.eq(r.first, 1)
	end)
end)
h.run()