What steps will reproduce the problem?
1. run JSONTest.testEncodeObject()
What is the expected output? What do you see instead?
Instead of using assertEquals on the encoded String, assertTrue is called
on the expected String, which always returns true as it is not null.
replace
assertTrue( "Deeply nested",
"{\"foo\":{\"foo2\":{\"foo3\":{\"foo4\":\"bar\"}}}}" );
with
assertEquals( "Deeply nested",
"{\"foo\":{\"foo2\":{\"foo3\":{\"foo4\":\"bar\"}}}}", s );
and
assertTrue( "Prop with spaces", "{\" prop with spaces \":true}" );
with
s = JSON.encode( obj );
assertTrue( "Prop with spaces", "{\" prop with spaces \":true}", s );
Original issue reported on code.google.com by herb.dom...@googlemail.com on 27 Aug 2008 at 9:35
Original issue reported on code.google.com by
herb.dom...@googlemail.com
on 27 Aug 2008 at 9:35