File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
src/test/java/com/fasterxml/jackson/core/read Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -437,6 +437,35 @@ public void testFloatBoundary146Bytes() throws Exception
437
437
}
438
438
}
439
439
440
+ /*
441
+ /**********************************************************************
442
+ /* Tests, BigDecimal (core#677)
443
+ /**********************************************************************
444
+ */
445
+
446
+ public void testBigBigDecimals () throws Exception
447
+ {
448
+ _testBigBigDecimals (MODE_INPUT_STREAM );
449
+ _testBigBigDecimals (MODE_INPUT_STREAM_THROTTLED );
450
+ _testBigBigDecimals (MODE_READER );
451
+ _testBigBigDecimals (MODE_DATA_INPUT );
452
+ }
453
+
454
+ private void _testBigBigDecimals (int mode ) throws Exception
455
+ {
456
+ for (String asText : new String [] {
457
+ "50.016102539344819307741514415079435545110277821887074630242881493528776023690905378058352283823814945584087486290764920313665152884137840533937075179853255596515758851877960056849468879933122908090021571162427934915567330612627267701300492535817858361072169790783434196345863626810981153268939825893279523570322533446766188724600595265286542918045850353371520018451295635609248478721067200812355632099802713302132804777044107393832707173313768807959788098545050700242134577863569636367439867566923334792774940569273585734964008310245010584348384920574103306733020525390136397928777667088202296433541706175886006626333525007680397351405390927420825851036548474519239425298649420795296781692303253055152441850691276044546565109657012938963181532017974206315159305959543881191233733179735321461579808278383770345759408145745617032705494900390986476773247981270283533959979287340513398944113566999839889290733896874439682249327621463735375868408190435590094166575473967368412983975580104741004390308453023021214626015068027388545767003666342291064051883531202983476423138817666738346033272948508395214246047027012105246939488877506475824651688812245962816086719050192476878886543996441778751825677213412487177484703116405390741627076678284295993334231429145515176165808842776515287299275536932744066126348489439143701880784521312311735178716650919024092723485314329094064704170548551468318250179561508293077056611877488417962195965319219352314664764649802231780262169742484818333055713291103286608643184332535729978330383356321740509817475633105247757622805298711765784874873240679024286215940395303989612556865748135450980540945799394622053158729350598632915060818702520420240989908678141379300904169936776618861221839938283876222332124814830207073816864076428273177778788053613345444299361357958409716099682468768353446625063"
458
+ }) {
459
+ final String DOC = "[ " +asText +" ]" ;
460
+
461
+ JsonParser p = createParser (mode , DOC );
462
+ assertToken (JsonToken .START_ARRAY , p .nextToken ());
463
+ assertToken (JsonToken .VALUE_NUMBER_FLOAT , p .nextToken ());
464
+ final BigDecimal exp = new BigDecimal (asText );
465
+ assertEquals (exp , p .getDecimalValue ());
466
+ }
467
+ }
468
+
440
469
/*
441
470
/**********************************************************************
442
471
/* Tests, misc other
You can’t perform that action at this time.
0 commit comments