mediawiki-extensions-Scribunto/tests/phpunit/Engines/LuaSandbox/SandboxTests.lua
Reedy 1eecdac6de Capitalise Engines folder
Change-Id: I6d730d67decc859fd130fee5ec92b1cfb8d9ef64
2022-09-30 00:58:27 +00:00

19 lines
452 B
Lua

local testframework = require( 'Module:TestFramework' )
local function setfenv1()
setfenv( 10, {} )
end
local function getfenv1()
assert( getfenv( 10 ) == nil )
end
return testframework.getTestProvider( {
{ name = 'setfenv invalid level', func = setfenv1,
expect = "bad argument #1 to 'old_getfenv' (invalid level)",
},
{ name = 'getfenv invalid level', func = getfenv1,
expect = "bad argument #1 to 'old_getfenv' (invalid level)",
},
} )