Skip to content

Commit

Permalink
Add a unit test for numeric facts.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 721366446
  • Loading branch information
kluever authored and Google Java Core Libraries committed Jan 30, 2025
1 parent b11598e commit 996fa8f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/src/test/java/com/google/common/truth/FactTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ public void twoFacts() {
.isEqualTo("foo : bar\nlonger name: other value");
}

@Test
public void numericFacts() {
assertThat(
makeMessage(
ImmutableList.<String>of(),
ImmutableList.of(
fact("expected", 802604),
fact("but was", 773804),
fact("outside tolerance", 9599))))
.isEqualTo("expected : 802604\nbut was : 773804\noutside tolerance: 9599");
}

@Test
public void oneFactWithoutValue() {
assertThat(makeMessage(ImmutableList.<String>of(), ImmutableList.of(simpleFact("foo"))))
Expand Down

0 comments on commit 996fa8f

Please sign in to comment.