Skip to content

Commit

Permalink
Update NonStandardNumberParsingTest.java
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Sep 12, 2024
1 parent 8f1c037 commit ccaec30
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,20 @@ void leadingDotInNegativeDecimalAllowedReader() throws Exception {
_testLeadingDotInNegativeDecimalAllowed(jsonFactory(), MODE_READER_THROTTLED);
}

// https://github.com/FasterXML/jackson-databind/issues/4694
@Test
void databind4694() throws Exception {
final String str = "-11000.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
final BigDecimal expected = new BigDecimal(str);
for (int mode : ALL_MODES) {
try (JsonParser p = createParser(mode, String.format(" %s ", str))) {
assertEquals(JsonToken.VALUE_NUMBER_FLOAT, p.nextToken());
assertEquals(expected, p.getDecimalValue());
assertFalse(p.isNaN());
}
}
}

private void _testLeadingDotInDecimalAllowed(JsonFactory f, int mode) throws Exception
{
try (JsonParser p = createParser(f, mode, " .125 ")) {
Expand Down

0 comments on commit ccaec30

Please sign in to comment.