diff --git a/tests/lua/mod52.lua b/tests/lua/mod52.lua index 7cc8c7e5..06e505e0 100644 --- a/tests/lua/mod52.lua +++ b/tests/lua/mod52.lua @@ -10,9 +10,17 @@ local _ENV,M = require 'pl.import_into' (rawget(_G,'STRICT')) function answer () -- of course, you don't have the usual global environment available -- so define it as a local up above, or use utils.import(_G). + + local versioned_errors = { + ["1"] = "attempt to call global 'print'", + ["2"] = "attempt to call global 'print'", + ["3"] = "attempt to call a nil value", + ["4"] = "attempt to call a nil value", + } + local expected = versioned_errors[LUA_VERSION:match("Lua 5.(%d)")] test.assertraise(function() print 'hello' - end,(LUA_VERSION~="Lua 5.3") and "attempt to call global 'print'" or "attempt to call a nil value") + end, expected) -- but all the Penlight modules are available return pretty.write(utils.split '10 20 30', '')