Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Sep 11, 2024
1 parent 3387ecb commit 7693244
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,21 @@ public class BigDecimalParsing4694Test extends DatabindTestUtil
}
BIG_DEC_STR = sb.toString();
}
private final BigDecimal BIG_DEC = new BigDecimal(BIG_DEC_STR);

private final ObjectMapper MAPPER = newJsonMapper();

// [databind#4694]: decoded wrong by jackson-core/FDP for over 500 char numbers
@Test
public void bigDecimal4694FromString() throws Exception
{
assertEquals(new BigDecimal(BIG_DEC_STR),
MAPPER.readValue(BIG_DEC_STR, BigDecimal.class));
assertEquals(BIG_DEC, MAPPER.readValue(BIG_DEC_STR, BigDecimal.class));
}

@Test
public void bigDecimal4694FromBytes() throws Exception
{
byte[] b = utf8Bytes(BIG_DEC_STR);
assertEquals(new BigDecimal(BIG_DEC_STR),
MAPPER.readValue(b, 0, b.length, BigDecimal.class));
assertEquals(BIG_DEC, MAPPER.readValue(b, 0, b.length, BigDecimal.class));
}
}

0 comments on commit 7693244

Please sign in to comment.