mirror of
https://github.com/stleary/JSON-java.git
synced 2026-01-24 00:03:17 -05:00
#947 add new failing tests with JSONTokener having strict mode configuration
This commit is contained in:
@@ -3853,6 +3853,15 @@ public class JSONObjectTest {
|
||||
assertEquals(j3.getString("hex6"), "0011");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testStrictModeJSONTokener_expectException(){
|
||||
JSONParserConfiguration jsonParserConfiguration = new JSONParserConfiguration().withStrictMode();
|
||||
JSONTokener tokener = new JSONTokener("{\"key\":\"value\"}invalidCharacters", jsonParserConfiguration);
|
||||
|
||||
assertThrows(JSONException.class, () -> { new JSONObject(tokener); });
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to build nested map of max maxDepth
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user