Skip to content

Commit 996fa8f

Browse files
klueverGoogle Java Core Libraries
authored andcommitted
Add a unit test for numeric facts.
PiperOrigin-RevId: 721366446
1 parent b11598e commit 996fa8f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

core/src/test/java/com/google/common/truth/FactTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ public void twoFacts() {
5454
.isEqualTo("foo : bar\nlonger name: other value");
5555
}
5656

57+
@Test
58+
public void numericFacts() {
59+
assertThat(
60+
makeMessage(
61+
ImmutableList.<String>of(),
62+
ImmutableList.of(
63+
fact("expected", 802604),
64+
fact("but was", 773804),
65+
fact("outside tolerance", 9599))))
66+
.isEqualTo("expected : 802604\nbut was : 773804\noutside tolerance: 9599");
67+
}
68+
5769
@Test
5870
public void oneFactWithoutValue() {
5971
assertThat(makeMessage(ImmutableList.<String>of(), ImmutableList.of(simpleFact("foo"))))

0 commit comments

Comments
 (0)