[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Syntax error with lunitx and luajit
- From: Skwerlman <skwerlman@...>
- Date: Thu, 12 May 2016 06:18:51 +0000
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 <firstname.lastname@example.org> 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)
/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:
if _VERSION >= 'Lua 5.2' then
_ENV = lunit.module('test_libcrypt','seeall')
module("test_libcrypt", lunit.testcase, package.seeall) -- markthis as a test case
if arg:match("[._%w]*$") == 'test_libcrypt.lua' then
I don't see a way to report a bug at github.com/dcurrie/lunit
Anybody know how to fix this?