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
The following line, JSONAssert.assertEquals("[{id:1},]" , "[{id:1},{}]" , true);,
which inputs an invalid JSON string "[{id:1},]" to assertEquals,
will throw java.lang.NullPointerException.
(I think the string is invalid because the JsonArray contains no more element after a comma.)
By the way, the following line, JSONAssert.assertEquals("[{id:1},]" , "[{id:1},{}]" , false);,
throws org.json.JSONException: Value at 1 is null. Maybe this exception is expected rather than NullPointerException?
The following lines does not throw anything: JSONAssert.assertNotEquals("[{id:1},]" , "[{id:2},]" , true); // pass JSONAssert.assertEquals("[{id:1},]" , "[{id:1},]" , true); // pass
These examples are related to invalid JSON strings, which are inspired by example from another issue #127 talking about the length of invalid JsonArray.
The text was updated successfully, but these errors were encountered:
The following line,
JSONAssert.assertEquals("[{id:1},]" , "[{id:1},{}]" , true);
,which inputs an invalid JSON string "[{id:1},]" to assertEquals,
will throw
java.lang.NullPointerException
.(I think the string is invalid because the JsonArray contains no more element after a comma.)
By the way, the following line,
JSONAssert.assertEquals("[{id:1},]" , "[{id:1},{}]" , false);
,throws
org.json.JSONException: Value at 1 is null
. Maybe this exception is expected rather than NullPointerException?The following lines does not throw anything:
JSONAssert.assertNotEquals("[{id:1},]" , "[{id:2},]" , true); // pass
JSONAssert.assertEquals("[{id:1},]" , "[{id:1},]" , true); // pass
These examples are related to invalid JSON strings, which are inspired by example from another issue #127 talking about the length of invalid JsonArray.
The text was updated successfully, but these errors were encountered: