mirror of
https://github.com/ethauvin/JSON-java.git
synced 2025-06-17 07:50:52 -07:00
Update test for issue https://github.com/stleary/JSON-java/issues/356
This commit is contained in:
parent
974a5f7d5d
commit
aa562b5ec3
1 changed files with 7 additions and 4 deletions
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue