commit | e067e92905c1802ff634cb78584d871b8feda846 | [log] [tgz] |
---|---|---|
author | peteg <peteg@google.com> | Thu Mar 21 03:04:53 2019 -0700 |
committer | Ron Shapiro <shapiro.rd@gmail.com> | Tue Apr 02 10:07:20 2019 -0400 |
tree | 980d8a4fd352edca4bfdca34d18d6570b3122007 | |
parent | fec8c4f5123d557eb3b0cfd238e0ecc673bb6840 [diff] |
Make `IterableSubject.<A, E>comparingElementsUsing` accept `Correspondence<? super A, ? super E>` instead of `Correspondence<A, E>`. And similarly for MapSubject and MultimapSubject. This accurately reflects the correct constraint. It also allows things which aren't possible at the moment, e.g. making assertions about an iterable of a subtype using a correspondence which accepts the supertype and then doing displayingDiffsPairedBy using a key function which accepts the subtype. (The caller will need to specify the generics rather than letting them be inferred, but at least it's possible --- right now, doing this would require an unchecked cast.) While we're at it, replace `? extends Object` with the simpler `?` in a few places. RELNOTES=n/a ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=239564279
Truth makes your test assertions and failure messages more readable. Similar to AssertJ, it natively supports many JDK and Guava types, and it is extensible to others.
Truth is owned and maintained by the Guava team. It is used from the majority of the tests in Google’s own codebase.
Read more at the main website.