Skip to content

Commit 77fd92c

Browse files
authored
Update NumberParsingTest.java (#979)
1 parent 0de50fb commit 77fd92c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/test/java/com/fasterxml/jackson/core/read/NumberParsingTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,18 @@ public void testIntWithENotation() throws Exception {
500500
}
501501
}
502502

503+
public void testLargeBigIntegerWithENotation() throws Exception {
504+
// slightly bigger than Double.MAX_VALUE (we need to avoid parsing as double in this case)
505+
final String DOC = "2e308 ";
506+
final BigInteger expected = new BigDecimal(DOC.trim()).toBigInteger();
507+
for (int mode : ALL_MODES) {
508+
try (JsonParser p = createParser(jsonFactory(), mode, DOC)) {
509+
assertToken(JsonToken.VALUE_NUMBER_FLOAT, p.nextToken());
510+
assertEquals(expected, p.getBigIntegerValue());
511+
}
512+
}
513+
}
514+
503515
/*
504516
/**********************************************************************
505517
/* Tests, floating point (basic)

0 commit comments

Comments
 (0)