We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent af3b7dc commit 52ecc89Copy full SHA for 52ecc89
1 file changed
src/test/java/org/json/junit/JSONArrayTest.java
@@ -79,6 +79,21 @@ public void emptStr() {
79
e.getMessage());
80
}
81
82
+
83
+ /**
84
+ * Attempt to create a JSONArray with an unclosed array.
85
+ * Expects an exception
86
+ */
87
+ @Test
88
+ public void unclosedArray() {
89
+ try {
90
+ assertNull("Should throw an exception", new JSONArray("["));
91
+ } catch (JSONException e) {
92
+ assertEquals("Expected an exception message",
93
+ "A JSONArray text must start with '[' at 0 [character 1 line 1]",
94
+ e.getMessage());
95
+ }
96
97
98
/**
99
* Attempt to create a JSONArray with a string as object that is
0 commit comments