File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
src/test/java/tools/jackson/failing Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments