示例工程 17-oop-patterns
17-oop-patterns/03-closure-object/_test.lua
-- @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.first, 1)
h.eq(r.second, 1)
h.eq(r.outside, nil)
end)
end)
h.run()