Skip to content

Commit 1967bee

Browse files
author
John J. Aylward
committed
expands the coercion tests a little more
1 parent 0150639 commit 1967bee

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,6 +2025,9 @@ public void jsonObjectOptStringConversion() {
20252025

20262026
// the integer portion of the actual value is larger than a double can hold.
20272027
assertNotEquals((long)Double.parseDouble("19007199254740993.35481234487103587486413587843213584"), jo.optLong("largeNumber"));
2028+
assertNotEquals((int)Double.parseDouble("19007199254740993.35481234487103587486413587843213584"), jo.optInt("largeNumber"));
2029+
assertEquals(19007199254740992l, (long)Double.parseDouble("19007199254740993.35481234487103587486413587843213584"));
2030+
assertEquals(2147483647, (int)Double.parseDouble("19007199254740993.35481234487103587486413587843213584"));
20282031
}
20292032

20302033
/**

0 commit comments

Comments
 (0)