mediawiki-extensions-Scribunto/tests/engines/LuaSandbox/SandboxTests.lua

20 lines
338 B
Lua
Raw Normal View History

local test = require( 'Module:CommonTests' )
local sbtest = {}
function sbtest.getTests()
return {
{ 'setfenv1', { error = '%sinvalid level%s' } },
{ 'getfenv1', { error = '%sinvalid level%s' } },
}
end
function sbtest.setfenv1()
2012-05-22 03:56:07 +00:00
setfenv( 3, {} )
end
function sbtest.getfenv1()
2012-05-22 03:56:07 +00:00
assert( getfenv( 3 ) == nil )
end
return sbtest