We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5623335 commit e94100bCopy full SHA for e94100b
hamcrest-core/src/test/java/org/hamcrest/core/IsEqualTest.java
@@ -77,6 +77,20 @@ public boolean equals(Object obj) {
77
assertDoesNotMatch(matcher, null);
78
}
79
80
+ @Test public void
81
+ comparesTheElementsOfArraysWithNulls() {
82
+ String[] s1 = {"a", null, "b"};
83
+ String[] s2 = {"a", null, "b"};
84
+ String[] s3 = {"c", "d"};
85
+ String[] s4 = {"a", "b", "c", "d"};
86
+
87
+ final Matcher<String[]> matcher = equalTo(s1);
88
+ assertMatches(matcher, s1);
89
+ assertMatches(matcher, s2);
90
+ assertDoesNotMatch(matcher, s3);
91
+ assertDoesNotMatch(matcher, s4);
92
+ }
93
94
@Test public void
95
comparesTheElementsOfAnArrayOfPrimitiveTypes() {
96
int[] i1 = new int[]{1, 2};
0 commit comments