Skip to content

Commit 8dd870c

Browse files
committed
add unit test for mismatch description of hasItems
1 parent 4688174 commit 8dd870c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎hamcrest-unit-test/src/main/java/org/hamcrest/collection/IsCollectionContainingTest.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ public void testMatchesAllItemsInCollection() {
8383
asList("e", "c", "b", "d")); // 'a' missing
8484
}
8585

86+
public void testReportsMismatchWithAReadableDescription() {
87+
final Matcher<Iterable<Integer>> matcher = hasItems(1, 4);
88+
89+
assertMismatchDescription("a collection containing <4> was <1>, was <2>, was <3>", matcher, asList(1, 2, 3));
90+
}
8691

8792
private static Matcher<? super String> mismatchable(final String string) {
8893
return new TypeSafeDiagnosingMatcher<String>() {

0 commit comments

Comments
 (0)