示例工程 05-variables-and-scope

05-variables-and-scope/01-local-scope-shadowing/_test.lua

lua · 0.3 KB

-- @runtimes lua54 luajit
local h = require("harness")
local m = require("main")
 
h.describe("作用域遮蔽", function()
	h.it("内层修改不影响外层", function()
		local result = m.run(function() end)
		h.eq(result.outer, 1)
		h.eq(result.after, 1)
	end)
end)
 
h.run()