Skip to content

Commit da1e2da

Browse files
author
George Bouroutzoglou
committed
Fix equal arrays check that depended on String comparison
This was presumed to use iteration and AssertEquals for each element
1 parent 8a7f293 commit da1e2da

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/test/java/gr/geompokon/bitarray/BitArrayInterfaceTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ void initArrays(int noOfElements) {
6363
* Asserts that the two lists have the same exact contents
6464
*/
6565
void myAssertSameArrays() {
66-
assertEquals(boolArray, bitArray);
66+
for (int i = 0; i < boolArray.size(); i++) {
67+
assertEquals(boolArray.get(i), bitArray.get(i));
68+
}
6769
}
6870

6971
/**

src/test/java/gr/geompokon/bitarray/BitArrayTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,12 @@ void initArrays(int noOfElements) {
5959
}
6060

6161
/**
62-
* Asserts that the two arrays have the exact same contents
62+
* Asserts that the two lists have the same exact contents
6363
*/
6464
void myAssertSameArrays() {
65-
assertEquals(boolArray, bitArray);
65+
for (int i = 0; i < boolArray.size(); i++) {
66+
assertEquals(boolArray.get(i), bitArray.get(i));
67+
}
6668
}
6769

6870
/**

0 commit comments

Comments
 (0)