Software /
code /
prosody
Diff
tests/test.lua @ 7063:bc1b375f379e
Merge 0.10->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 08 Jan 2016 16:21:05 +0100 |
parent | 7062:90e8bbfbaabd |
child | 7072:3121054e665f |
line wrap: on
line diff
--- a/tests/test.lua Mon Jan 04 09:14:57 2016 +0000 +++ b/tests/test.lua Fri Jan 08 16:21:05 2016 +0100 @@ -140,9 +140,12 @@ end local oldmodule, old_M = _fakeG.module, _fakeG._M; - _fakeG.module = function () _M = unit end + _fakeG.module = function () + setmetatable(unit, nil); + unit._M = unit; + end setfenv(chunk, unit); - local success, ret = pcall(chunk); + local success, err = pcall(chunk); _fakeG.module, _fakeG._M = oldmodule, old_M; if not success then print("WARNING: ", "Failed to initialise module: "..unitname, err);