Skip to content

Commit 6bb2a0a

Browse files
committed
move tests
1 parent 4f540a3 commit 6bb2a0a

File tree

2 files changed

+38
-38
lines changed

2 files changed

+38
-38
lines changed

src/test/java/com/fasterxml/jackson/core/read/NonStandardNumberParsingTest.java

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ class NonStandardNumberParsingTest
2121
.enable(JsonReadFeature.ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERS)
2222
.enable(JsonReadFeature.ALLOW_TRAILING_DECIMAL_POINT_FOR_NUMBERS)
2323
.build();
24-
private final String ISSUE_4694_VALUE =
25-
"-11000.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
26-
2724

2825
protected JsonFactory jsonFactory() {
2926
return JSON_F;
@@ -246,41 +243,6 @@ void leadingDotInNegativeDecimalAllowedReader() throws Exception {
246243
_testLeadingDotInNegativeDecimalAllowed(jsonFactory(), MODE_READER_THROTTLED);
247244
}
248245

249-
// https://github.com/FasterXML/jackson-databind/issues/4694
250-
@Test
251-
void databind4694() throws Exception {
252-
final BigDecimal expected = new BigDecimal(ISSUE_4694_VALUE);
253-
for (int mode : ALL_MODES) {
254-
try (JsonParser p = createParser(mode, String.format(" %s ", ISSUE_4694_VALUE))) {
255-
assertEquals(JsonToken.VALUE_NUMBER_FLOAT, p.nextToken());
256-
assertEquals(expected, p.getDecimalValue());
257-
assertFalse(p.isNaN());
258-
}
259-
}
260-
}
261-
262-
void databind4694Double() throws Exception {
263-
final Double expected = new Double(ISSUE_4694_VALUE);
264-
for (int mode : ALL_MODES) {
265-
try (JsonParser p = createParser(mode, String.format(" %s ", ISSUE_4694_VALUE))) {
266-
assertEquals(JsonToken.VALUE_NUMBER_FLOAT, p.nextToken());
267-
assertEquals(expected, p.getDoubleValue());
268-
assertFalse(p.isNaN());
269-
}
270-
}
271-
}
272-
273-
void databind4694Float() throws Exception {
274-
final Float expected = new Float(ISSUE_4694_VALUE);
275-
for (int mode : ALL_MODES) {
276-
try (JsonParser p = createParser(mode, String.format(" %s ", ISSUE_4694_VALUE))) {
277-
assertEquals(JsonToken.VALUE_NUMBER_FLOAT, p.nextToken());
278-
assertEquals(expected, p.getFloatValue());
279-
assertFalse(p.isNaN());
280-
}
281-
}
282-
}
283-
284246
private void _testLeadingDotInDecimalAllowed(JsonFactory f, int mode) throws Exception
285247
{
286248
try (JsonParser p = createParser(f, mode, " .125 ")) {

src/test/java/com/fasterxml/jackson/core/read/NumberParsingTest.java

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ protected JsonFactory jsonFactory() {
2828
return sharedStreamFactory();
2929
}
3030

31+
private final String ISSUE_4694_VALUE =
32+
"-11000.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
33+
3134
/*
3235
/**********************************************************************
3336
/* Tests, Boolean
@@ -996,6 +999,41 @@ void negativeMaxNumberLength() {
996999
}
9971000
}
9981001

1002+
// https://github.com/FasterXML/jackson-databind/issues/4694
1003+
@Test
1004+
void databind4694() throws Exception {
1005+
final BigDecimal expected = new BigDecimal(ISSUE_4694_VALUE);
1006+
for (int mode : ALL_MODES) {
1007+
try (JsonParser p = createParser(mode, String.format(" %s ", ISSUE_4694_VALUE))) {
1008+
assertEquals(JsonToken.VALUE_NUMBER_FLOAT, p.nextToken());
1009+
assertEquals(expected, p.getDecimalValue());
1010+
assertFalse(p.isNaN());
1011+
}
1012+
}
1013+
}
1014+
1015+
void databind4694Double() throws Exception {
1016+
final Double expected = new Double(ISSUE_4694_VALUE);
1017+
for (int mode : ALL_MODES) {
1018+
try (JsonParser p = createParser(mode, String.format(" %s ", ISSUE_4694_VALUE))) {
1019+
assertEquals(JsonToken.VALUE_NUMBER_FLOAT, p.nextToken());
1020+
assertEquals(expected, p.getDoubleValue());
1021+
assertFalse(p.isNaN());
1022+
}
1023+
}
1024+
}
1025+
1026+
void databind4694Float() throws Exception {
1027+
final Float expected = new Float(ISSUE_4694_VALUE);
1028+
for (int mode : ALL_MODES) {
1029+
try (JsonParser p = createParser(mode, String.format(" %s ", ISSUE_4694_VALUE))) {
1030+
assertEquals(JsonToken.VALUE_NUMBER_FLOAT, p.nextToken());
1031+
assertEquals(expected, p.getFloatValue());
1032+
assertFalse(p.isNaN());
1033+
}
1034+
}
1035+
}
1036+
9991037
/*
10001038
/**********************************************************
10011039
/* Helper methods

0 commit comments

Comments
 (0)