mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-12-04 20:58:13 +00:00
7418a571ac
Iaa880531 added extra frames in the call stack, so the frame being tested by the "setfenv invalid level" and "getfenv invalid level" tests was no longer invalid. Bug: T175065 Change-Id: Id1028e7c8bbb92fb9d7d01ebeabd94e8ba284b1c
19 lines
454 B
Lua
19 lines
454 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)",
|
|
},
|
|
} )
|