1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00

Add test that an invalid escape sequence results in a JSONException and not a NumberFormatException.

This commit is contained in:
Mads Ager 2016-06-02 16:41:43 +02:00
parent 51bcbebaa8
commit c7fdada0fd

View file

@ -1924,4 +1924,10 @@ public class JSONObjectTest {
public void optQueryWithSyntaxError() {
new JSONObject().optQuery("invalid");
}
@Test(expected = JSONException.class)
public void invalidEscapeSequence() {
String json = "{ \"\\url\": \"value\" }";
new JSONObject(json);
}
}