mediawiki-extensions-Scribunto/tests/engines/LuaStandalone/StandaloneTests.lua

21 lines
348 B
Lua
Raw Normal View History

local test = require( 'Module:CommonTests' )
local satest = {}
function satest.getTests()
return {
{ 'setfenv1', { error = '%s cannot set the requested environment%s' } },
2012-05-22 03:56:07 +00:00
{ 'getfenv1', 'ok' },
}
end
function satest.setfenv1()
2012-05-22 03:56:07 +00:00
setfenv( 4, {} )
end
function satest.getfenv1()
2012-05-22 03:56:07 +00:00
assert( getfenv( 4 ) == nil )
return 'ok'
end
return satest