Skip to content

Commit 972272b

Browse files
committed
Merge branch '2.18'
2 parents 86fb86c + 5606536 commit 972272b

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package tools.jackson.failing;
2+
3+
import java.math.BigDecimal;
4+
5+
import org.junit.jupiter.api.Test;
6+
7+
import tools.jackson.core.JUnit5TestBase;
8+
import tools.jackson.core.JsonParser;
9+
import tools.jackson.core.JsonToken;
10+
11+
import static org.junit.jupiter.api.Assertions.assertEquals;
12+
import static org.junit.jupiter.api.Assertions.assertFalse;
13+
14+
class NumberParsing4694Test
15+
extends JUnit5TestBase
16+
{
17+
// https://github.com/FasterXML/jackson-databind/issues/4694
18+
@Test
19+
void databind4694() throws Exception {
20+
final String str = "-11000.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
21+
final BigDecimal expected = new BigDecimal(str);
22+
for (int mode : ALL_MODES) {
23+
try (JsonParser p = createParser(mode, String.format(" %s ", str))) {
24+
assertEquals(JsonToken.VALUE_NUMBER_FLOAT, p.nextToken());
25+
assertEquals(expected, p.getDecimalValue());
26+
assertFalse(p.isNaN());
27+
}
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)