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()
|
2017-09-05 19:37:39 +00:00
|
|
|
setfenv( 10, {} )
|
2012-04-19 07:40:56 +00:00
|
|
|
end
|
|
|
|
|
2012-12-19 20:10:01 +00:00
|
|
|
local function getfenv1()
|
2017-09-05 19:37:39 +00:00
|
|
|
assert( getfenv( 10 ) == 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)",
|
|
|
|
},
|
|
|
|
} )
|