Merge pull request #76 from johnjaylward/WriteJavadocUpdate

Update test for issue https://github.com/stleary/JSON-java/issues/356
This commit is contained in:
Sean Leary 2017-07-15 18:46:58 -05:00 committed by GitHub
commit 1aeadd1765

View File

@ -1622,10 +1622,13 @@ public class JSONObjectTest {
" ]\n" + " ]\n" +
"}"; "}";
JSONObject jsonObject = new JSONObject(jsonObject0Str); JSONObject jsonObject = new JSONObject(jsonObject0Str);
assertEquals(jsonObject0Str, jsonObject.toString()); assertEquals("toString()",jsonObject0Str, jsonObject.toString());
assertEquals(jsonObject0Str, jsonObject.toString(0)); assertEquals("toString(0)",jsonObject0Str, jsonObject.toString(0));
assertEquals(jsonObject1Str, jsonObject.toString(1)); assertEquals("toString(1)",jsonObject1Str, jsonObject.toString(1));
assertEquals(jsonObject4Str, jsonObject.toString(4)); 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));
} }
/** /**