1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 16:00:51 -07:00

extra long integer test

This commit is contained in:
Douglas Crockford 2011-10-25 10:11:29 -07:00
parent d34be7fa21
commit df6190f3fc

View file

@ -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-24 * @version 2011-10-25
*/ */
public class Test extends TestCase { public class Test extends TestCase {
public Test(String name) { public Test(String name) {
@ -68,9 +68,9 @@ public class Test extends TestCase {
assertEquals("{\"test\": {\n \"blank\": \"\",\n \"empty\": \"\"\n}}", jsonobject.toString(2)); assertEquals("{\"test\": {\n \"blank\": \"\",\n \"empty\": \"\"\n}}", jsonobject.toString(2));
assertEquals("<test><blank/><empty/></test>", XML.toString(jsonobject)); assertEquals("<test><blank/><empty/></test>", XML.toString(jsonobject));
string = "<subsonic-response><playlists><playlist id=\"476c65652e6d3375\"/><playlist id=\"50617274792e78737066\"/></playlists></subsonic-response>"; string = "<subsonic-response><playlists><playlist id=\"476c65652e6d3375\" int=\"12345678901234567890123456789012345678901234567890213991133777039355058536718668104339937\"/><playlist id=\"50617274792e78737066\"/></playlists></subsonic-response>";
jsonobject = XML.toJSONObject(string); jsonobject = XML.toJSONObject(string);
assertEquals("{\"subsonic-response\":{\"playlists\":{\"playlist\":[{\"id\":\"476c65652e6d3375\"},{\"id\":\"50617274792e78737066\"}]}}}", jsonobject.toString()); assertEquals("{\"subsonic-response\":{\"playlists\":{\"playlist\":[{\"id\":\"476c65652e6d3375\",\"int\":\"12345678901234567890123456789012345678901234567890213991133777039355058536718668104339937\"},{\"id\":\"50617274792e78737066\"}]}}}", jsonobject.toString());
} }
public void testNull() throws Exception { public void testNull() throws Exception {