Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hints for data classes if using toEqual #151

Open
robstoll opened this issue Sep 16, 2019 · 1 comment
Open

hints for data classes if using toEqual #151

robstoll opened this issue Sep 16, 2019 · 1 comment

Comments

@robstoll
Copy link
Owner

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.

@robstoll robstoll added this to the 0.10.0 milestone Sep 16, 2019
@jGleitz
Copy link
Collaborator

jGleitz commented Sep 16, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants