Skip to content

Commit

Permalink
Merge branch '2.18'
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Sep 21, 2024
2 parents 8cab937 + b9d56af commit 47e5a60
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/test/java/tools/jackson/core/read/NumberParsingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ void bigNumbers() throws Exception
BigInteger biggie = new BigInteger(NUMBER_STR);

for (int mode : ALL_MODES) {
try (JsonParser p = createParser(jsonFactory(), mode, NUMBER_STR +" ")) {
try (JsonParser p = createParser(jsonFactory(), mode, NUMBER_STR + " ")) {
assertToken(JsonToken.VALUE_NUMBER_INT, p.nextToken());
assertEquals(JsonParser.NumberType.BIG_INTEGER, p.getNumberType());
assertEquals(NUMBER_STR, p.getText());
Expand All @@ -472,6 +472,26 @@ void bigNumbers() throws Exception
}
}

@Test
void intsWith19Chars() throws Exception
{
final String[] values = new String[] {
"9223372036854775808", "9999999999999999999"
};
for (String value : values) {
BigInteger biggie = new BigInteger(value);

for (int mode : ALL_MODES) {
try (JsonParser p = createParser(jsonFactory(), mode, value + " ")) {
assertToken(JsonToken.VALUE_NUMBER_INT, p.nextToken());
assertEquals(JsonParser.NumberType.BIG_INTEGER, p.getNumberType());
assertEquals(biggie, p.getBigIntegerValue());
assertEquals(value, p.getText());
}
}
}
}

// Related to [core#1135]: JsonParser.isNaN() should not be fooled
// by possible Double overflow
@Test
Expand Down

0 comments on commit 47e5a60

Please sign in to comment.