Skip to content

Commit

Permalink
Handle JSONString differences
Browse files Browse the repository at this point in the history
  • Loading branch information
trickl committed Oct 18, 2019
1 parent 6a30aec commit 14ec13e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONString;
import org.skyscreamer.jsonassert.FieldComparisonFailure;

public class FieldComparisonFailureFormatter {
Expand Down Expand Up @@ -54,6 +55,8 @@ private static String describe(Object value) {
return "a JSON array";
} else if (value instanceof JSONObject) {
return "a JSON object";
} else if (value instanceof JSONString) {
return ((JSONString) value).toJSONString();
} else {
return "'" + value.toString() + "'";
}
Expand Down

0 comments on commit 14ec13e

Please sign in to comment.