Skip to content

Commit

Permalink
Add failing test for #90
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed May 3, 2022
1 parent e22a96c commit 4a49a35
Showing 1 changed file with 30 additions and 0 deletions.
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());
}
}

0 comments on commit 4a49a35

Please sign in to comment.