Skip to content

Truth 0.40

Compare
Choose a tag to compare
@cpovirk cpovirk released this 28 Mar 21:05
· 767 commits to master since this release
  • Added check(String template, Object... args). Most users of check() should migrate. If the new method doesn't suit your needs, please file a bug. (187a969)
  • Removed getDisplaySubject(), and marked actualCustomStringRepresentation() as @ForOverride. Callers should use actualAsString(); overriders should use actualCustomStringRepresentation(). (47ea976, 24d4c96)
  • Made assertThat(array).isEqualTo(otherArray) compare arrays contents (not array identity) even when the input wasn't statically known to be an array. (ece35ac)
  • Began cleaning stack traces from custom subjects outside of core Truth. (7a6f69d)
  • Enhanced Expect to omit stack frames common to multiple failures. (48b31f7)
  • Put any user messages on their own lines, separate from the main failure message. (6d060b8)
  • Tweaked the format of array failure messages. (ece35ac)
  • Removed the type name from the output of arrays. (f4fabf2)
  • For array subjects, made named() supplement the existing actual value text, not replace it. This brings it in line with other subjects' behaviors. (f4fabf2)
  • Tweaked failure messages for array asList() assertions. (df5c101)
  • Tweaked failure messages for isAnyOf, isNone, and isNotIn to be more consistent. (6233d1b)
  • Changed Subject.fail(String, Object) to stop including class names if the Object's toString() representation matches the value under test's. (This is likely to be uncommon unless you are overriding isEqualTo(), in which case we recommend delegating to super.isEqualTo() when possible.) (7af9c56)
  • Stopped calling actual.equals(null); all objects are assumed to be not equal to null. (c1ab4ed)
  • Added displayingDiffsPairedBy to IterableOfProtosSubject. (a51fc7a)
  • Add support for float and double comparisons in ProtoTruth. (6cd8068)
  • Check only the descriptor identity before comparing messages in ProtoSubject. (7df5790)
  • Add formatted diffs for ProtoTruth Correspondence comparisons. (4b790a3)
  • Removed deprecated (Object expected, double tolerance) overloads of isEqualTo() and isNotEqualTo(). (ca04f65)
  • Added the @CompatibleWith annotation from http://errorprone.info to isSameAs, isNotSameAs, isAnyOf, and isNoneOf. (2487651)
  • Made assertThat(...).is{,Not}InstanceOf(SomeInterface.class) blow up with a helpful message under GWT, rather than always fail in the case of isInstanceOf and always succeed in the case of isNotInstanceOf. (026d922)
  • Made assertThat(null).isInstanceOf(...) fail() under GWT instead of throw NullPointerException. (026d922)