mirror of
https://github.com/TangentFoxy/lua-sandbox.git
synced 2025-07-27 18:42:21 +00:00
tests - add test for overriding base env with false
This commit is contained in:
@@ -135,6 +135,11 @@ describe('sandbox.run', function()
|
|||||||
local env = { tostring = function(x) return "hello " .. x end }
|
local env = { tostring = function(x) return "hello " .. x end }
|
||||||
assert.equal("hello peter", sandbox.run("return tostring('peter')", { env = env }))
|
assert.equal("hello peter", sandbox.run("return tostring('peter')", { env = env }))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('can override the base env with false', function()
|
||||||
|
local env = { tostring = false }
|
||||||
|
assert.equal(false, sandbox.run("return tostring", { env = env }))
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user