Skip to content

Commit

Permalink
Code Check 2 23 2
Browse files Browse the repository at this point in the history
  • Loading branch information
sathishk committed Mar 1, 2024
1 parent 547a777 commit 76dfb4e
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/test/java/com/techatpark/sjson/core/NumberParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class NumberParserTest {
@ParameterizedTest
@MethodSource("numbers")
void testValid(final Number originalValue) throws IOException {
Assertions.assertEquals(originalValue, new Json().read(new StringReader(originalValue.toString())));
String jsonString = objectMapper.writeValueAsString(originalValue);
Assertions.assertEquals(originalValue.toString(), new Json().read(new StringReader(jsonString)).toString());
}

/**
Expand All @@ -58,7 +59,22 @@ private static List<Number> numbers() {
BigInteger.valueOf(Long.MAX_VALUE).multiply(BigInteger.TEN),
Float.MIN_VALUE,
Float.MAX_VALUE,
Double.MIN_VALUE
Double.MIN_VALUE,
123,
-456,
12.34,
-0.567,
1.23e4,
5.67E-8,
0.456,
1.23e001,
+789,
0.4e006,
0.4e-006,
0.4e+006,
4e006,
4e-006,
4e+006
);
}

Expand Down

0 comments on commit 76dfb4e

Please sign in to comment.