@@ -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}
0 commit comments