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:
parent
51bcbebaa8
commit
c7fdada0fd
1 changed files with 6 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue