Skip to content

Commit ef938f8

Browse files
authored
Merge pull request #1 from LightingTom/LightingTom-patch-1
Fix plural problem in some descriptions
2 parents 523009b + a767718 commit ef938f8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/main/java/org/skyscreamer/jsonassert/comparator/DefaultComparator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ public void compareValues(String prefix, Object expectedValue, Object actualValu
7777
public void compareJSONArray(String prefix, JSONArray expected, JSONArray actual, JSONCompareResult result)
7878
throws JSONException {
7979
if (expected.length() != actual.length()) {
80-
result.fail(prefix + "[]: Expected " + expected.length() + " values but got " + actual.length());
80+
String description = " values but got ";
81+
if (expected.length() == 1) description = " value but got ";
82+
result.fail(prefix + "[]: Expected " + expected.length() + description + actual.length());
8183
return;
8284
} else if (expected.length() == 0) {
8385
return; // Nothing to compare

0 commit comments

Comments
 (0)