Skip to content

Commit

Permalink
Merge pull request stleary#49 from madsager/master
Browse files Browse the repository at this point in the history
Add test that an invalid escape sequence results in a JSONException a…
  • Loading branch information
stleary committed Jun 8, 2016
2 parents 51bcbeb + c7fdada commit 40f170b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/org/json/junit/JSONObjectTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1924,4 +1924,10 @@ public void optQueryWithNoResult() {
public void optQueryWithSyntaxError() {
new JSONObject().optQuery("invalid");
}

@Test(expected = JSONException.class)
public void invalidEscapeSequence() {
String json = "{ \"\\url\": \"value\" }";
new JSONObject(json);
}
}

0 comments on commit 40f170b

Please sign in to comment.