projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5360e1b
)
tests/test.lua: Fix fake module() function to prevent _M from being _G (test.lua...
author
Matthew Wild
<mwild1@gmail.com>
Wed, 6 Jan 2016 00:24:06 +0000
(
00:24
+0000)
committer
Matthew Wild
<mwild1@gmail.com>
Wed, 6 Jan 2016 00:24:06 +0000
(
00:24
+0000)
tests/test.lua
patch
|
blob
|
history
diff --git
a/tests/test.lua
b/tests/test.lua
index de1e40fd8bb96166154cf78f16a6ccc08d2dac81..bb11ab267bd487584e8782b70d47f83af20728cd 100644
(file)
--- a/
tests/test.lua
+++ b/
tests/test.lua
@@
-137,7
+137,10
@@
function dotest(unitname)
end
local oldmodule, old_M = _fakeG.module, _fakeG._M;
- _fakeG.module = function () _M = _G end
+ _fakeG.module = function ()
+ setmetatable(unit, nil);
+ unit._M = unit;
+ end
setfenv(chunk, unit);
local success, err = pcall(chunk);
_fakeG.module, _fakeG._M = oldmodule, old_M;