mirror of
https://github.com/stleary/JSON-java.git
synced 2026-05-18 00:00:50 -04:00
feat(#877): improved JSONArray and JSONTokener logic
JSONArray construction improved to recursive validation JSONTokener implemented smallCharMemory and array level for improved validation Added new test cases and minor test case adaption
This commit is contained in:
@@ -142,7 +142,7 @@ public class JSONArrayTest {
|
||||
assertNull("Should throw an exception", new JSONArray("["));
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expected an exception message",
|
||||
"Expected a ',' or ']' at 1 [character 2 line 1]",
|
||||
"Expected a ',' or ']' but instead found '[' at 1 [character 2 line 1]",
|
||||
e.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -157,7 +157,7 @@ public class JSONArrayTest {
|
||||
assertNull("Should throw an exception", new JSONArray("[\"test\""));
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expected an exception message",
|
||||
"Expected a ',' or ']' at 7 [character 8 line 1]",
|
||||
"Expected a ',' or ']' but instead found '\"' at 7 [character 8 line 1]",
|
||||
e.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,7 @@ public class JSONArrayTest {
|
||||
assertNull("Should throw an exception", new JSONArray("[\"test\","));
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expected an exception message",
|
||||
"Expected a ',' or ']' at 8 [character 9 line 1]",
|
||||
"Expected a ',' or ']' but instead found ',' at 8 [character 9 line 1]",
|
||||
e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user