mirror of
https://github.com/ethauvin/JSON-java.git
synced 2025-06-17 16:00:51 -07:00
Bad XML
This commit is contained in:
parent
90e62b0e1b
commit
3e3951f125
1 changed files with 18 additions and 9 deletions
11
Test.java
11
Test.java
|
@ -40,7 +40,7 @@ SOFTWARE.
|
||||||
* comparisons of .toString to a string literal are likely to fail.
|
* comparisons of .toString to a string literal are likely to fail.
|
||||||
*
|
*
|
||||||
* @author JSON.org
|
* @author JSON.org
|
||||||
* @version 2011-10-03
|
* @version 2011-10-05
|
||||||
*/
|
*/
|
||||||
public class Test extends TestCase {
|
public class Test extends TestCase {
|
||||||
public Test(String name) {
|
public Test(String name) {
|
||||||
|
@ -838,6 +838,15 @@ public class Test extends TestCase {
|
||||||
assertEquals("Mismatched 'right' and 'wrong' at 15 [character 16 line 1]", jsone.getMessage());
|
assertEquals("Mismatched 'right' and 'wrong' at 15 [character 16 line 1]", jsone.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
string = "This ain't XML.";
|
||||||
|
jsonarray = JSONML.toJSONArray(string);
|
||||||
|
System.out.println(jsonarray.toString(4));
|
||||||
|
fail("expecting JSONException here.");
|
||||||
|
} catch (JSONException jsone) {
|
||||||
|
assertEquals("Bad XML at 17 [character 18 line 1]", jsone.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
string = "{\"koda\": true, \"koda\": true}";
|
string = "{\"koda\": true, \"koda\": true}";
|
||||||
jsonobject = new JSONObject(string);
|
jsonobject = new JSONObject(string);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue