lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Maybe try adding `local print = print` around line 47? Quickly glancing at the code, print is the only global not made into a local this way. Aside from that, you could try changing the print on line 722 to an error, though that might have other consequences.

On May 11, 2016 6:32:23 PM EDT, Dan Christian <> wrote:
I'm running into an odd syntax error when running lunitx under luajit 2.0.

$ luajit test_libcrypt.lua --help
luajit: /usr/local/share/lua/5.1/lunit.lua:737: attempt to call global
'print' (a nil value)
stack traceback:
/usr/local/share/lua/5.1/lunit.lua:737: in function 'main'
test_libcrypt.lua:44: in main chunk

I can run tests just fine. Other command line switches seem to get
parsed. It's only the help that's broken. I have a specific reason
to avoid the sh wrapper script. I using this on an embedded system
with limited shell support.

LuaJIT reports as 5.1, so I'm assuming it's related to the 5.1 module support.

Here is the code:
#!/usr/bin/env luajit
if _VERSION >= 'Lua 5.2' then
_ENV = lunit.module('test_libcrypt','seeall')
module("test_libcrypt", lunit.testcase, package.seeall) -- markthis as a test case

function test_LibCrypt()

if arg[0]:match("[._%w]*$") == 'test_libcrypt.lua' then

I don't see a way to report a bug at

Anybody know how to fix this?