示例工程 02-values-and-types
02-values-and-types/02-nil-vs-absent/_test.lua
-- @runtimes lua54 luajit
local h = require("harness")
local m = require("main")
h.describe("nil 与缺失", function()
h.it("赋 nil 删除键", function()
local result = m.run(function() end)
h.eq(result.count, 3)
h.eq(result.keys, { "a", "c", "flag" })
h.eq(result.absent, true)
end)
h.it("false 存在,不等于 nil", function()
local result = m.run(function() end)
h.eq(result.false_is_nil, false)
end)
end)
h.run()