Skip to content

Commit

Permalink
Update NumberParsingTest.java (#976)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning authored Apr 5, 2023
1 parent 9309439 commit 4b20c1f
Showing 1 changed file with 3 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -448,15 +448,7 @@ public void testBigNumbers() throws Exception

public void testBigIntegerWithENotation() throws Exception {
final String DOC = "1e5 ";

final int[] modes = new int[]{
MODE_INPUT_STREAM,
MODE_INPUT_STREAM_THROTTLED,
MODE_READER,
MODE_READER_THROTTLED,
MODE_DATA_INPUT
};
for (int mode : modes) {
for (int mode : ALL_MODES) {
try (JsonParser p = createParser(jsonFactory(), mode, DOC)) {
assertToken(JsonToken.VALUE_NUMBER_FLOAT, p.nextToken());
assertEquals(100000L, p.getBigIntegerValue().longValue());
Expand All @@ -466,15 +458,7 @@ public void testBigIntegerWithENotation() throws Exception {

public void testLongWithENotation() throws Exception {
final String DOC = "1e5 ";

final int[] modes = new int[]{
MODE_INPUT_STREAM,
MODE_INPUT_STREAM_THROTTLED,
MODE_READER,
MODE_READER_THROTTLED,
MODE_DATA_INPUT
};
for (int mode : modes) {
for (int mode : ALL_MODES) {
try (JsonParser p = createParser(jsonFactory(), mode, DOC)) {
assertToken(JsonToken.VALUE_NUMBER_FLOAT, p.nextToken());
assertEquals(100000L, p.getLongValue());
Expand All @@ -484,15 +468,7 @@ public void testLongWithENotation() throws Exception {

public void testIntWithENotation() throws Exception {
final String DOC = "1e5 ";

final int[] modes = new int[]{
MODE_INPUT_STREAM,
MODE_INPUT_STREAM_THROTTLED,
MODE_READER,
MODE_READER_THROTTLED,
MODE_DATA_INPUT
};
for (int mode : modes) {
for (int mode : ALL_MODES) {
try (JsonParser p = createParser(jsonFactory(), mode, DOC)) {
assertToken(JsonToken.VALUE_NUMBER_FLOAT, p.nextToken());
assertEquals(100000, p.getIntValue());
Expand Down

0 comments on commit 4b20c1f

Please sign in to comment.