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 @@ -168,7 +168,7 @@ private Feature(boolean defaultState) {
168
168
169
169
protected final static long MIN_INT_AS_LONG = (long ) Integer .MIN_VALUE ;
170
170
protected final static long MAX_INT_AS_LONG = (long ) Integer .MAX_VALUE ;
171
- protected final static Pattern PLAIN_NUMBER_P = Pattern .compile ("[0-9]*(\\ .[0-9]*)?" );
171
+ protected final static Pattern PLAIN_NUMBER_P = Pattern .compile ("-? [0-9]*(\\ .[0-9]*)?" );
172
172
protected final static String TAG_BINARY = Tag .BINARY .toString ();
173
173
174
174
/* As per <a href="https://yaml.org/type/bool.html">YAML Spec</a> there are a few
Original file line number Diff line number Diff line change @@ -133,6 +133,13 @@ public void testQuoteNumberStoredAsString() throws Exception
133
133
134
134
assertEquals ("---\n " +
135
135
"key: 2.0.1.2.3" , yaml );
136
+
137
+ content .clear ();
138
+ content .put ("key" , "-60" );
139
+ yaml = mapper .writeValueAsString (content ).trim ();
140
+
141
+ assertEquals ("---\n " +
142
+ "key: \" -60\" " , yaml );
136
143
}
137
144
138
145
public void testNonQuoteNumberStoredAsString () throws Exception
You can’t perform that action at this time.
0 commit comments