diff --git a/src/test/java/org/json/junit/JSONParserConfigurationTest.java b/src/test/java/org/json/junit/JSONParserConfigurationTest.java index b4cf2cb77..a37f5a40b 100644 --- a/src/test/java/org/json/junit/JSONParserConfigurationTest.java +++ b/src/test/java/org/json/junit/JSONParserConfigurationTest.java @@ -31,7 +31,7 @@ public void testOverwrite() { @Test public void givenInvalidInputArrays_testStrictModeTrue_shouldThrowJsonException() { - List strictModeInputTestCases = Arrays.asList("[1,2];[3,4]", "", "[1, 2,3]:[4,5]"/*, "[{test: implied}]"*/); + List strictModeInputTestCases = Arrays.asList("[1,2];[3,4]", "", "[1, 2,3]:[4,5]", "[{test: implied}]"); JSONParserConfiguration jsonParserConfiguration = new JSONParserConfiguration() .withStrictMode(true); @@ -43,6 +43,15 @@ public void givenInvalidInputArrays_testStrictModeTrue_shouldThrowJsonException( }); } + @Test + public void givenInvalidInputArrays_testStrictModeFalse_shouldNotThrowAnyException() { + List strictModeInputTestCases = Arrays.asList("[1,2];[3,4]", "[1, 2,3]:[4,5]", "[{test: implied}]"); + JSONParserConfiguration jsonParserConfiguration = new JSONParserConfiguration() + .withStrictMode(false); + + strictModeInputTestCases.stream().peek(System.out::println).forEach(testCase -> new JSONArray(testCase, jsonParserConfiguration)); + } + @Test public void verifyDuplicateKeyThenMaxDepth() { JSONParserConfiguration jsonParserConfiguration = new JSONParserConfiguration()