-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e22a96c
commit 4a49a35
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
jr-stree/src/test/java/com/fasterxml/jackson/jr/stree/failing/ReadAsBigDecimal90Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.fasterxml.jackson.jr.stree.failing; | ||
|
||
import java.math.BigDecimal; | ||
|
||
import com.fasterxml.jackson.core.TreeNode; | ||
|
||
import com.fasterxml.jackson.jr.ob.*; | ||
import com.fasterxml.jackson.jr.stree.*; | ||
|
||
public class ReadAsBigDecimal90Test extends JacksonJrTreeTestBase | ||
{ | ||
// [jackson-jr#90] | ||
public void testReadAsBigDecimal() throws Exception | ||
{ | ||
JSON json = JSON.builder() | ||
.treeCodec(new JacksonJrsTreeCodec()) | ||
.enable(JSON.Feature.USE_BIG_DECIMAL_FOR_FLOATS) | ||
.build(); | ||
|
||
String input = "[1.1]"; | ||
|
||
TreeNode node = json.treeFrom(input); | ||
TreeNode elemNode = node.get(0); | ||
|
||
assertTrue(elemNode.isValueNode()); | ||
assertTrue(elemNode instanceof JrsNumber); | ||
assertEquals(BigDecimal.class, | ||
((JrsNumber) elemNode).getValue().getClass()); | ||
} | ||
} |