bluebird75 / luaunit

LuaUnit is a popular unit-testing framework for Lua, with an interface typical of xUnit libraries (Python unittest, Junit, NUnit, ...). It supports several output formats (Text, TAP, JUnit, ...) to be used directly or work with Continuous Integration platforms (Jenkins, Maven, ...).
Other
565 stars 136 forks source link

luaunit conflicts with strict #152

Open jjvbsag opened 1 year ago

jjvbsag commented 1 year ago

Luaunit does not run with strict

Simple test with plain lua5.1

require"strict"
local lu=require"luaunit.luaunit"

returns lua5.1: ./luaunit.luaunit.lua:21: variable 'jit' is not declared

Test with luajit (same simple test) returns ./luaunit/luaunit.lua:2069: variable 'EXPORT_ASSERT_TO_GLOBALS' is not declared

badiku commented 7 months ago

I changed line 21 like this:

M._LUAVERSION = rawget(_ENV, 'jit') and jit.version or _VERSION

and line 66:

-- EXPORT_ASSERT_TO_GLOBALS = true
local EXPORT_ASSERT_TO_GLOBALS =  rawget(_ENV, 'EXPORT_ASSERT_TO_GLOBALS') and EXPORT_ASSERT_TO_GLOBALS
bluebird75 commented 7 months ago

Thanks.

Can you provide a Pull Request and I'll merge it.