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
572 stars 137 forks source link

Adapt randomseed to Lua 5.4 #130

Closed javalikescript closed 4 years ago

javalikescript commented 4 years ago

The math.randomseed method has been updated in Lua 5.4, see Lua reference. The current luaunit usage fails occasionally with the error "bad argument # 1 to 'randomseed' (number has no integer representation)". This pull request will call the method without arguments when using Lua 5.4.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 98.747% when pulling 56f977470e4b21a503e81cd7c5868c246de5fbf6 on javalikescript:master into dab49f725f58020bca831d5dd2c3b3a7ef61e59b on bluebird75:master.

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-0.07%) to 98.679% when pulling 5440cb856d23fed9f88b69a859c822d511448f72 on javalikescript:master into dab49f725f58020bca831d5dd2c3b3a7ef61e59b on bluebird75:master.

javalikescript commented 4 years ago

For the sake of the coverage, I modified the pull request to avoid testing the Lua version. The bad part is that it not more use the new Lua 5.4 random seed.

bluebird75 commented 4 years ago

The decrease in coverage is just because I don't have lua 5.4 in the CI pipeline yet. Don't worry about that.

Ordering test randomly does not need a strong random generator though, I believe we can live with suboptimal seed :-)

javalikescript commented 4 years ago

I am in favor of the new Lua 5.4 random seed but I do not like the Lua version test. The seed using a single line also helps to read the code so I will stick to it, for now.

bluebird75 commented 4 years ago

Thanks. I'll try to add proper support for Lua 5.4