Skip to content

Commit 1f75aa2

Browse files
committed
Correct tests assertion
[skip ci]
1 parent 0510e46 commit 1f75aa2

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/test/java/com/slicingdice/jslicer/SlicingDiceTester.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,21 +449,22 @@ private boolean compareJsonArray(final JSONArray expected, final JSONArray got)
449449
return false;
450450
}
451451

452-
if (expected.length() == 0 && got.length() == 0) {
453-
return true;
454-
}
455-
456452
for (int i = 0; i < expected.length(); ++i) {
457453
final Object valueExpected = expected.get(i);
454+
boolean hasTrue = false;
458455
for (int j = 0; j < got.length(); j++) {
459456
final Object valueGot = got.get(j);
460457
if (this.compareJsonValue(valueExpected, valueGot)) {
461-
return true;
458+
hasTrue = true;
462459
}
463460
}
461+
462+
if (!hasTrue) {
463+
return false;
464+
}
464465
}
465466

466-
return false;
467+
return true;
467468
}
468469

469470
/**

0 commit comments

Comments
 (0)