mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-03 11:25:30 -04:00
Add test that an invalid escape sequence results in a JSONException and not a NumberFormatException.
This commit is contained in:
parent
51bcbebaa8
commit
c7fdada0fd
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user