mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-05 10:15:19 +08:00
test(#871-strictMode): strict mode false initial implementation
This commit is contained in:
@@ -31,7 +31,7 @@ public class JSONParserConfigurationTest {
|
||||
|
||||
@Test
|
||||
public void givenInvalidInputArrays_testStrictModeTrue_shouldThrowJsonException() {
|
||||
List<String> strictModeInputTestCases = Arrays.asList("[1,2];[3,4]", "", "[1, 2,3]:[4,5]"/*, "[{test: implied}]"*/);
|
||||
List<String> 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 class JSONParserConfigurationTest {
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenInvalidInputArrays_testStrictModeFalse_shouldNotThrowAnyException() {
|
||||
List<String> 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()
|
||||
|
Reference in New Issue
Block a user