Skip to content

Commit 04661ef

Browse files
committed
fixed tests to avoid module function on new Lua versions
1 parent 6c66031 commit 04661ef

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/module2.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
module( "module2" )
1+
if _VERSION == "Lua 5.1" then
2+
module( "module2" )
3+
else
4+
local _M = {}
5+
package.loaded[ "module2" ] = _M
6+
_ENV = _M
7+
end
28

39
function func()
410
return "module2"

0 commit comments

Comments
 (0)