File tree 2 files changed +8
-1
lines changed
main/java/com/fasterxml/jackson/dataformat/yaml
test/java/com/fasterxml/jackson/dataformat/yaml/ser
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ private Feature(boolean defaultState) {
172
172
173
173
protected final static long MIN_INT_AS_LONG = (long ) Integer .MIN_VALUE ;
174
174
protected final static long MAX_INT_AS_LONG = (long ) Integer .MAX_VALUE ;
175
- protected final static Pattern PLAIN_NUMBER_P = Pattern .compile ("[0-9]*(\\ .[0-9]*)?" );
175
+ protected final static Pattern PLAIN_NUMBER_P = Pattern .compile ("-? [0-9]*(\\ .[0-9]*)?" );
176
176
protected final static String TAG_BINARY = Tag .BINARY .toString ();
177
177
178
178
// for field names, leave out quotes
Original file line number Diff line number Diff line change @@ -186,6 +186,13 @@ public void testQuoteNumberStoredAsString() throws Exception
186
186
187
187
assertEquals ("---\n " +
188
188
"key: 2.0.1.2.3" , yaml );
189
+
190
+ content .clear ();
191
+ content .put ("key" , "-60" );
192
+ yaml = mapper .writeValueAsString (content ).trim ();
193
+
194
+ assertEquals ("---\n " +
195
+ "key: \" -60\" " , yaml );
189
196
}
190
197
191
198
public void testNonQuoteNumberStoredAsString () throws Exception
You can’t perform that action at this time.
0 commit comments