示例工程 08-table-structure

08-table-structure/02-length-border/_test.lua

lua · 0.4 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.count, 3)
		h.truthy(r.border == 2 or r.border == 4)
	end)
	h.it("ipairs 在洞处停止", function()
		local r = m.run(function() end)
		h.eq(r.ipairs_stop, 2)
	end)
end)
h.run()