We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0150639 commit 1967beeCopy full SHA for 1967bee
1 file changed
src/test/java/org/json/junit/JSONObjectTest.java
@@ -2025,6 +2025,9 @@ public void jsonObjectOptStringConversion() {
2025
2026
// the integer portion of the actual value is larger than a double can hold.
2027
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"));
2031
}
2032
2033
/**
0 commit comments