Skip to content

Commit

Permalink
cleanup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
trobro committed Aug 13, 2023
1 parent 8f5a352 commit a118976
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/test/org/hjson/test/TestFunctions.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,23 @@ static void Exec() {
} catch (NumberFormatException e) {
}

String jsonString = "[\n[\n=\n[[\'\'\'\'\'\'";
try {
JsonValue.readHjson(jsonString);
throw new RuntimeException("Accepted non-terminated array");
} catch (ParseException e) {
}
String jsonString = "['''''']";
JsonValue.readHjson(jsonString);

try {
JsonValue.readHjson(_nestedDoc(TOO_DEEP_NESTING, "[ ", "] ", "0"));
throw new RuntimeException("Accepted too deep array in Hjson");
} catch (ParseException e) {
}
try {
JsonValue.readHjson(_nestedDoc(TOO_DEEP_NESTING, "{ ", "} ", "0"));
throw new RuntimeException("Accepted too deep object in Hjson");
} catch (ParseException e) {
}
try {
JsonValue.readJSON(_nestedDoc(TOO_DEEP_NESTING, "[ ", "] ", "0"));
throw new RuntimeException("Accepted too deep array in JSON");
} catch (ParseException e) {
}
try {
JsonValue.readJSON(_nestedDoc(TOO_DEEP_NESTING, "{ ", "} ", "0"));
throw new RuntimeException("Accepted too deep object in JSON");
} catch (ParseException e) {
}
}
Expand Down

0 comments on commit a118976

Please sign in to comment.