Skip to content

Commit

Permalink
fix testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed May 7, 2022
1 parent e17793d commit 0668444
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,16 @@ public void test_isValidArray_bytes() {

@Test
public void test_isValidObject() {
assertFalse(JSON.isValidObject((String) null));
assertFalse(JSON.isValidObject(""));
assertFalse(JSON.isValidObject("123"));
assertFalse(JSON.isValidObject("1}"));
assertFalse(JSON.isValidObject("\"aaa\""));
assertFalse(JSON.isValidObject("\"aaa\"}"));
assertTrue(JSON.isValidObject("{}"));
assertFalse(JSON.isValidObject("{}]"));
assertFalse(JSON.isValidObject("{]"));
assertFalse(JSON.isValidObject("{"));
assertFalse(JSON.isValidObject("[]"));
assertFalse(JSON.isValidObject("[]]"));
}
Expand All @@ -83,6 +87,8 @@ public void test_isValidObject_bytes() {
assertFalse(JSON.isValidObject("\"aaa\"}".getBytes(StandardCharsets.UTF_8)));
assertTrue(JSON.isValidObject("{}".getBytes(StandardCharsets.UTF_8)));
assertFalse(JSON.isValidObject("{}]".getBytes(StandardCharsets.UTF_8)));
assertFalse(JSON.isValidObject("{]".getBytes(StandardCharsets.UTF_8)));
assertFalse(JSON.isValidObject("{".getBytes(StandardCharsets.UTF_8)));
assertFalse(JSON.isValidObject("[]".getBytes(StandardCharsets.UTF_8)));
assertFalse(JSON.isValidObject("[]]".getBytes(StandardCharsets.UTF_8)));
}
Expand Down

0 comments on commit 0668444

Please sign in to comment.