mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-03 03:15:32 -04:00
test(#871-strictMode): strict mode false initial implementation
This commit is contained in:
parent
63e8314deb
commit
c140e91bb8
@ -31,7 +31,7 @@ public class JSONParserConfigurationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenInvalidInputArrays_testStrictModeTrue_shouldThrowJsonException() {
|
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()
|
JSONParserConfiguration jsonParserConfiguration = new JSONParserConfiguration()
|
||||||
.withStrictMode(true);
|
.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
|
@Test
|
||||||
public void verifyDuplicateKeyThenMaxDepth() {
|
public void verifyDuplicateKeyThenMaxDepth() {
|
||||||
JSONParserConfiguration jsonParserConfiguration = new JSONParserConfiguration()
|
JSONParserConfiguration jsonParserConfiguration = new JSONParserConfiguration()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user