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

why aren't they equal? #120

Closed JackXuXin closed 5 years ago

JackXuXin commented 5 years ago

image

bluebird75 commented 5 years ago

That looks strange indeed. I'll try to have a look

bluebird75 commented 5 years ago

I tried to reproduce your problem but did not succeed. Which version of Lua and LuaUnit are you using ? Is the content of the table really what is being displayed ?

bluebird75 commented 5 years ago
Lua 5.2.3  Copyright (C) 1994-2013 Lua.org, PUC-Rio
> lu = require('luaunit')
> lu.assertEquals( {1}, {1.0} )
> lu.assertEquals( {a=1}, {a=1.0} )
> lu.assertEquals( 1, 2 )
stdin:1: LuaUnit test FAILURE: expected: 2, actual: 1
stack traceback:
        [C]: in function 'error'
        ./luaunit.lua:1190: in function 'failure'
        ./luaunit.lua:1276: in function 'assertEquals'
        stdin:1: in main chunk
        [C]: in ?
> lu.assertEquals( {free=0, multiple=17}, {free=0, multiple=17.0} ) -- see, no error generated
> ^Z

$ lua51
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> lu = require('luaunit')
> lu.assertEquals( {free=0, multiple=17}, {free=0, multiple=17.0} ) -- see, no error generated
> ^Z

$ lua53
Lua 5.3.0  Copyright (C) 1994-2015 Lua.org, PUC-Rio
> lu = require('luaunit')
> lu.assertEquals( {free=0, multiple=17}, {free=0, multiple=17.0} ) -- see, no error generated
> ^Z

$
bluebird75 commented 5 years ago

Can you check with the master version of LuaUnit ? It could be a duplicate of #122 which I just closed.

bluebird75 commented 5 years ago

Closing after lack of feedback and no reproducability.