truth icon indicating copy to clipboard operation
truth copied to clipboard

Add a reflective field equality based subject and correspondence.

Open cgruber opened this issue 6 years ago • 5 comments

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

cgruber avatar Jul 10 '19 23:07 cgruber

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

cgruber avatar Jul 22 '19 19:07 cgruber

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

cpovirk avatar Jul 24 '19 13:07 cpovirk

No worries. :)

cgruber avatar Jul 30 '19 17:07 cgruber

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?

cgruber avatar Feb 19 '20 15:02 cgruber

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?

cpovirk avatar Feb 19 '20 22:02 cpovirk