lunarmodules / luassert

Assertion library for Lua
MIT License
202 stars 76 forks source link

change(format) format tables in output including their id #161

Closed Tieske closed 5 years ago

Tieske commented 5 years ago

This format changes the table serialization, by including the table id

Previous assert.are.equal({},{}) output:

Passed in:
(table) { }
Expected:
(table) { }

New assert.are.equal({},{}) output:

Passed in:
(table: 0x0fd935c8) { }
Expected:
(table: 0x0fd935a0) { }

This makes the message clearer when tables look the same but are not equal. Down side of this change is that the problem is shifted to the same assertion, which now becomes less clear.

Yet, because equal is more frequently used than same, this makes sense anyway.

Tieske commented 5 years ago

ping @ajacksified @DorianGray