Skip to content

Commit

Permalink
Minor test changes prepping for #784
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jun 28, 2022
1 parent 21c94df commit 2999710
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void testLeadingPlusSignInDecimalAllowedBytes() throws Exception {

public void testLeadingPlusSignInDecimalAllowedReader() throws Exception {
_testLeadingPlusSignInDecimalAllowed(jsonFactory(), MODE_READER);
// _testLeadingPlusSignInDecimalAllowed(jsonFactory(), MODE_READER_THROTTLED);
_testLeadingPlusSignInDecimalAllowed(jsonFactory(), MODE_READER_THROTTLED);
}

public void testLeadingDotInNegativeDecimalAllowedAsync() throws Exception {
Expand Down Expand Up @@ -144,6 +144,8 @@ private void _testLeadingPlusSignInDecimalAllowed(JsonFactory f, int mode) throw
assertEquals(JsonToken.VALUE_NUMBER_INT, p.nextToken());
assertEquals(125.0, p.getValueAsDouble());
assertEquals("125", p.getDecimalValue().toString());
// 27-Jun-2022, tatu: As per [core#784] this SHOULD include leading
// plug sign
assertEquals("125", p.getText());
}
try (JsonParser p = createParser(f, mode, " +0.125 ")) {
Expand All @@ -156,7 +158,12 @@ private void _testLeadingPlusSignInDecimalAllowed(JsonFactory f, int mode) throw
assertEquals(JsonToken.VALUE_NUMBER_FLOAT, p.nextToken());
assertEquals(0.125, p.getValueAsDouble());
assertEquals("0.125", p.getDecimalValue().toString());
assertEquals("+.125", p.getText());
// 27-Jun-2022, tatu: As per [core#784] this SHOULD include leading
// plug sign. But worse, looks like sometimes it does sometimes not
final String text = p.getText();
if (!"+.125".equals(text) && !".125".equals(text)) {
fail("Bad textual representation: ["+text+"]");
}
}
}

Expand Down

0 comments on commit 2999710

Please sign in to comment.