2012-12-19 20:10:01 +00:00
|
|
|
local testframework = require( 'Module:TestFramework' )
|
2012-04-19 07:40:56 +00:00
|
|
|
|
2012-12-19 20:10:01 +00:00
|
|
|
local function setfenv1()
|
|
|
|
setfenv( 5, {} )
|
2012-04-19 07:40:56 +00:00
|
|
|
end
|
|
|
|
|
2012-12-19 20:10:01 +00:00
|
|
|
local function getfenv1()
|
|
|
|
assert( getfenv( 5 ) == nil )
|
2012-04-19 07:40:56 +00:00
|
|
|
end
|
|
|
|
|
2012-12-19 20:10:01 +00:00
|
|
|
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)",
|
|
|
|
},
|
|
|
|
} )
|