1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 16:00:51 -07:00
This commit is contained in:
Douglas Crockford 2011-10-05 12:30:20 -07:00
parent 90e62b0e1b
commit 3e3951f125

View file

@ -40,7 +40,7 @@ SOFTWARE.
* comparisons of .toString to a string literal are likely to fail.
*
* @author JSON.org
* @version 2011-10-03
* @version 2011-10-05
*/
public class Test extends TestCase {
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());
}
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 {
string = "{\"koda\": true, \"koda\": true}";
jsonobject = new JSONObject(string);