You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A JSON object or array that contains a value of type JSONString will never register as "similar" to another object or array that contains an equivalent JSONString. Given that JSONString has a single function that returns a string, and that the string representation of that json will always be the same, the similar method should evaluate them to true.
To demonstrate, these are couple of tests that can be dropped into the existing JUnit suite:
JSONObject jo1 = new JSONObject()
.put("a", new MyJsonString());
JSONObject jo2 = new JSONObject()
.put("a", new MyJsonString());
assertTrue(jo1.toString().equals(jo2.toString())); // true
assertTrue(jo1.similar(jo2)); // false
JSONArray ja1 = new JSONArray()
.put(new MyJsonString());
JSONArray ja2 = new JSONArray()
.put(new MyJsonString());
assertTrue(ja1.toString().equals(ja2.toString())); // true
assertTrue(ja1.similar(ja2)); // false
The text was updated successfully, but these errors were encountered:
A JSON object or array that contains a value of type JSONString will never register as "similar" to another object or array that contains an equivalent JSONString. Given that JSONString has a single function that returns a string, and that the string representation of that json will always be the same, the
similar
method should evaluate them to true.To demonstrate, these are couple of tests that can be dropped into the existing JUnit suite:
The text was updated successfully, but these errors were encountered: