Skip to content

Commit 40f170b

Browse files
committed
Merge pull request #49 from madsager/master
Add test that an invalid escape sequence results in a JSONException a…
2 parents 51bcbeb + c7fdada commit 40f170b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/test/org/json/junit/JSONObjectTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1924,4 +1924,10 @@ public void optQueryWithNoResult() {
19241924
public void optQueryWithSyntaxError() {
19251925
new JSONObject().optQuery("invalid");
19261926
}
1927+
1928+
@Test(expected = JSONException.class)
1929+
public void invalidEscapeSequence() {
1930+
String json = "{ \"\\url\": \"value\" }";
1931+
new JSONObject(json);
1932+
}
19271933
}

0 commit comments

Comments
 (0)