Skip to content

Commit e4b76d6

Browse files
author
John J. Aylward
committed
Add test to demonstrate the issue. See stleary#573
1 parent 3a8193b commit e4b76d6

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/test/java/org/json/junit/JSONObjectTest.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,17 @@ public void verifySimilar() {
115115
.put("key2", 2)
116116
.put("key3", new String(string1));
117117

118-
assertFalse("Should eval to false", obj1.similar(obj2));
118+
JSONObject obj4 = new JSONObject()
119+
.put("key1", "abc")
120+
.put("key2", 2.0)
121+
.put("key3", new String(string1));
119122

123+
assertFalse("Should eval to false", obj1.similar(obj2));
124+
120125
assertTrue("Should eval to true", obj1.similar(obj3));
121126

127+
assertTrue("Should eval to true", obj1.similar(obj4));
128+
122129
}
123130

124131
@Test

0 commit comments

Comments
 (0)