atrium
atrium copied to clipboard
hints for data classes if using toEqual
Platform (jvm, jdk8, js, android): all
Code related feature
expect(person).toBe(anotherPerson)
assuming Person is a data class. Currently one has to see the difference based on the representation of the two objects. It would be sweet if we compare the fields one by one and list those which do not match in the failure hint. Yet, only in the failure hint as one could override equals and we don't want to change this behaviour. We could even check if equals is overriden and warn the user.
I like the proposal! But I think that this part:
We could even check if equals is overriden and warn the user.
is essential. Because with overridden equals, the fields reporting could be very confusing to the user.