Skip to content

Commit

Permalink
Tiny test refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jun 13, 2024
1 parent 577fe9c commit a18a482
Showing 1 changed file with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,27 +104,24 @@ public void testBigIntegerUnlimited() throws Exception

// [databind#4435]
@Test
public void testNumberStartingWithDot() throws Exception
{
String num = ".555555555555555555555555555555";
BigDecimalWrapper w = MAPPER.readValue("{\"number\":\"" + num + "\"}", BigDecimalWrapper.class);
assertEquals(new BigDecimal(num), w.number);
public void testNumberStartingWithDot() throws Exception {
_testNumberWith(".555555555555555555555555555555");
}

// [databind#4435]
@Test
public void testNumberStartingWithMinusDot() throws Exception
{
String num = "-.555555555555555555555555555555";
BigDecimalWrapper w = MAPPER.readValue("{\"number\":\"" + num + "\"}", BigDecimalWrapper.class);
assertEquals(new BigDecimal(num), w.number);
public void testNumberStartingWithMinusDot() throws Exception {
_testNumberWith("-.555555555555555555555555555555");
}

// [databind#4435]
@Test
public void testNumberStartingWithPlusDot() throws Exception
public void testNumberStartingWithPlusDot() throws Exception {
_testNumberWith("+.555555555555555555555555555555");
}

private void _testNumberWith(String num) throws Exception
{
String num = "+.555555555555555555555555555555";
BigDecimalWrapper w = MAPPER.readValue("{\"number\":\"" + num + "\"}", BigDecimalWrapper.class);
assertEquals(new BigDecimal(num), w.number);
}
Expand Down

0 comments on commit a18a482

Please sign in to comment.