Skip to content

Commit 4034625

Browse files
authored
enable previously failing tests (#783)
1 parent 840700d commit 4034625

2 files changed

Lines changed: 23 additions & 44 deletions

File tree

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,19 @@ public void testLeadingPlusSignInDecimalAllowedReader() throws Exception {
111111
_testLeadingPlusSignInDecimalAllowed(jsonFactory(), MODE_READER);
112112
}
113113

114+
public void testLeadingDotInNegativeDecimalAllowedAsync() throws Exception {
115+
_testLeadingDotInNegativeDecimalAllowed(jsonFactory(), MODE_DATA_INPUT);
116+
}
117+
118+
public void testLeadingDotInNegativeDecimalAllowedBytes() throws Exception {
119+
_testLeadingDotInNegativeDecimalAllowed(jsonFactory(), MODE_INPUT_STREAM);
120+
_testLeadingDotInNegativeDecimalAllowed(jsonFactory(), MODE_INPUT_STREAM_THROTTLED);
121+
}
122+
123+
public void testLeadingDotInNegativeDecimalAllowedReader() throws Exception {
124+
_testLeadingDotInNegativeDecimalAllowed(jsonFactory(), MODE_READER);
125+
}
126+
114127
private void _testLeadingDotInDecimalAllowed(JsonFactory f, int mode) throws Exception
115128
{
116129
try (JsonParser p = createParser(f, mode, " .125 ")) {
@@ -152,4 +165,14 @@ private void _testTrailingDotInDecimalAllowed(JsonFactory f, int mode) throws Ex
152165
assertEquals("125.", p.getText());
153166
}
154167
}
168+
169+
private void _testLeadingDotInNegativeDecimalAllowed(JsonFactory f, int mode) throws Exception
170+
{
171+
try (JsonParser p = createParser(f, mode, " -.125 ")) {
172+
assertEquals(JsonToken.VALUE_NUMBER_FLOAT, p.nextToken());
173+
assertEquals(-0.125, p.getValueAsDouble());
174+
assertEquals("-0.125", p.getDecimalValue().toString());
175+
assertEquals("-.125", p.getText());
176+
}
177+
}
155178
}

src/test/java/com/fasterxml/jackson/failing/FailingNonStandardNumberParsing782Test.java

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)