File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/test/java/org/json/junit Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 66
77import static org .junit .Assert .assertEquals ;
88import static org .junit .Assert .assertFalse ;
9- import static org .junit .Assert .assertSame ;
109import static org .junit .Assert .assertTrue ;
1110import static org .junit .Assert .fail ;
1211
@@ -328,10 +327,18 @@ public void testAutoClose(){
328327 }
329328
330329 @ Test
331- public void testInvalidInput_shouldThrowJSONException () {
330+ public void testInvalidInput_JSONObject_withoutStrictModel_shouldParseInput () {
332331 String input = "{\" invalidInput\" : [],}" ;
333332 JSONTokener tokener = new JSONTokener (input );
334333 Object value = tokener .nextValue ();
335334 assertEquals (new JSONObject (input ).toString (), value .toString ());
336335 }
336+
337+ @ Test
338+ public void testInvalidInput_JSONArray_withoutStrictModel_shouldParseInput () {
339+ String input = "[\" invalidInput\" ,]" ;
340+ JSONTokener tokener = new JSONTokener (input );
341+ Object value = tokener .nextValue ();
342+ assertEquals (new JSONArray (input ).toString (), value .toString ());
343+ }
337344}
You can’t perform that action at this time.
0 commit comments