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