Skip to content

Commit 2999710

Browse files
committed
Minor test changes prepping for #784
1 parent 21c94df commit 2999710

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

+9-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public void testLeadingPlusSignInDecimalAllowedBytes() throws Exception {
111111

112112
public void testLeadingPlusSignInDecimalAllowedReader() throws Exception {
113113
_testLeadingPlusSignInDecimalAllowed(jsonFactory(), MODE_READER);
114-
// _testLeadingPlusSignInDecimalAllowed(jsonFactory(), MODE_READER_THROTTLED);
114+
_testLeadingPlusSignInDecimalAllowed(jsonFactory(), MODE_READER_THROTTLED);
115115
}
116116

117117
public void testLeadingDotInNegativeDecimalAllowedAsync() throws Exception {
@@ -144,6 +144,8 @@ private void _testLeadingPlusSignInDecimalAllowed(JsonFactory f, int mode) throw
144144
assertEquals(JsonToken.VALUE_NUMBER_INT, p.nextToken());
145145
assertEquals(125.0, p.getValueAsDouble());
146146
assertEquals("125", p.getDecimalValue().toString());
147+
// 27-Jun-2022, tatu: As per [core#784] this SHOULD include leading
148+
// plug sign
147149
assertEquals("125", p.getText());
148150
}
149151
try (JsonParser p = createParser(f, mode, " +0.125 ")) {
@@ -156,7 +158,12 @@ private void _testLeadingPlusSignInDecimalAllowed(JsonFactory f, int mode) throw
156158
assertEquals(JsonToken.VALUE_NUMBER_FLOAT, p.nextToken());
157159
assertEquals(0.125, p.getValueAsDouble());
158160
assertEquals("0.125", p.getDecimalValue().toString());
159-
assertEquals("+.125", p.getText());
161+
// 27-Jun-2022, tatu: As per [core#784] this SHOULD include leading
162+
// plug sign. But worse, looks like sometimes it does sometimes not
163+
final String text = p.getText();
164+
if (!"+.125".equals(text) && !".125".equals(text)) {
165+
fail("Bad textual representation: ["+text+"]");
166+
}
160167
}
161168
}
162169

0 commit comments

Comments
 (0)