Add test to demonstrate the issue. See #573

This commit is contained in:
John J. Aylward 2020-11-19 18:18:27 -05:00
parent 3a8193bea4
commit e4b76d6588

View File

@ -115,10 +115,17 @@ public class JSONObjectTest {
.put("key2", 2) .put("key2", 2)
.put("key3", new String(string1)); .put("key3", new String(string1));
assertFalse("Should eval to false", obj1.similar(obj2)); JSONObject obj4 = new JSONObject()
.put("key1", "abc")
.put("key2", 2.0)
.put("key3", new String(string1));
assertFalse("Should eval to false", obj1.similar(obj2));
assertTrue("Should eval to true", obj1.similar(obj3)); assertTrue("Should eval to true", obj1.similar(obj3));
assertTrue("Should eval to true", obj1.similar(obj4));
} }
@Test @Test