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

Add a reflective field equality based subject and correspondence. #606

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cgruber
Copy link
Contributor

@cgruber cgruber commented Jul 10, 2019

This is written in Kotlin and depends on kotlin runtime as a result, however is designed to work cleanly from Java, and its kotlin origins should not be paritcularly noticeable to the test-writing developer.

The tests handle single object testing (via the Subject) and list element comparisons using a Correspondence. Field comparisons can be shallow or deep, and can respect (in the deep case) declared equals() methods or ignore them. It also can handle reference cycles (with caveats).

This is upstreamed from Square, Inc. and licensed under Apache 2.0.

Addresses #560

This is written in Kotlin and depends on kotlin runtime as a result, however is designed to work cleanly from Java, and its kotlin origins should not be paritcularly noticeable to the test-writing developer.

The tests handle single object testing (via the Subject) and list element comparisons using a Correspondence. Field comparisons can be shallow or deep, and can respect (in the deep case) declared `equals()` methods or ignore them.  It also can handle reference cycles (with caveats).

This is upstreamed from Square, Inc. and licensed under Apache 2.0.
@cgruber
Copy link
Contributor Author

cgruber commented Jul 22, 2019

Ping @cpovirk. :) (No rush if you're busy, but wanted to make sure it didn't fall in the cracks.

@cpovirk
Copy link
Member

cpovirk commented Jul 24, 2019

Sorry. It's on The List; things have just been crazier than expected lately.

@cgruber
Copy link
Contributor Author

cgruber commented Jul 30, 2019

No worries. :)

@cpovirk cpovirk added P3 not scheduled type=addition A new feature labels Jan 13, 2020
@cgruber
Copy link
Contributor Author

cgruber commented Feb 19, 2020

Hey @cpovirk - was just showing how github worked to a friend, and realized I have this Pr still hanging on. Any thoughts around moving it forward?

@cpovirk
Copy link
Member

cpovirk commented Feb 19, 2020

Sorry again. You can see how badly I estimated how much we'd be able to do with Truth in the months following the 1.0 release.

I am probably never going to review this as thoroughly as I'd hoped, but given that you've found it useful, I don't see a reason to let that block things. I will try harder to have a reasonable but less thorough look in the next couple weeks.

One thing I should check with you on: It looks like you're versioning this with the rest of Truth. So it will appear in 1.1, etc. Do you think that's OK, especially given that we're intending not to make breaking changes to Truth (and thus ideally wouldn't make them to this, either, since that would push us to Truth 2.0)? Or maybe it's fine to start by following Truth but then have Truth and your extension diverge in version numbers if you later want to make a breaking change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes P3 not scheduled type=addition A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants