This adds some new tests for JSONObject#valueToString() and JSONObject#write() methods. These are very similar in functionality, but have a subtle case that is different when creating a string for a JSONString object that returns null. Goes through cases where an exception is thrown, and where toString() also returns null.
Also fixed up a test on JSONStringer for object nesting, which didn't fail where it should've.
Finally, JSONObject#toMap() and JSONArray#toList() get some unit test coverage.
Also find a couple of tests currently commented out. These depend on the pull request #241 on JSON-java, that replaces Writer with Appendable. These tests won't compile until that request goes in, though it will also cause one of the tests in JSONStringTest to fail.
This adds some new tests for
JSONObject#valueToString()
andJSONObject#write()
methods. These are very similar in functionality, but have a subtle case that is different when creating a string for a JSONString object that returnsnull
. Goes through cases where an exception is thrown, and where toString() also returnsnull
.Also fixed up a test on
JSONStringer
for object nesting, which didn't fail where it should've.Finally,
JSONObject#toMap()
andJSONArray#toList()
get some unit test coverage.Also find a couple of tests currently commented out. These depend on the pull request #241 on JSON-java, that replaces Writer with Appendable. These tests won't compile until that request goes in, though it will also cause one of the tests in JSONStringTest to fail.