1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00
This commit is contained in:
John J. Aylward 2017-07-15 12:19:02 -04:00
parent 974a5f7d5d
commit aa562b5ec3

View file

@ -1622,10 +1622,13 @@ public class JSONObjectTest {
" ]\n" +
"}";
JSONObject jsonObject = new JSONObject(jsonObject0Str);
assertEquals(jsonObject0Str, jsonObject.toString());
assertEquals(jsonObject0Str, jsonObject.toString(0));
assertEquals(jsonObject1Str, jsonObject.toString(1));
assertEquals(jsonObject4Str, jsonObject.toString(4));
assertEquals("toString()",jsonObject0Str, jsonObject.toString());
assertEquals("toString(0)",jsonObject0Str, jsonObject.toString(0));
assertEquals("toString(1)",jsonObject1Str, jsonObject.toString(1));
assertEquals("toString(4)",jsonObject4Str, jsonObject.toString(4));
JSONObject jo = new JSONObject().put("TABLE", new JSONObject().put("yhoo", new JSONObject()));
assertEquals("toString(2)","{\"TABLE\": {\"yhoo\": {}}}", jo.toString(2));
}
/**