File tree 1 file changed +6
-2
lines changed
src/test/java/com/fasterxml/jackson/databind
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -202,8 +202,8 @@ public void testCopyWith() throws Exception {
202
202
assertEquals ("Black" , readResult .get ("color" ).asText ());
203
203
assertEquals (true , readResult .get ("free" ).asBoolean ());
204
204
assertEquals (204 , readResult .get ("pages" ).asInt ());
205
- String readResultAsString = "{\n \" color\" : \" Black\" ,\n \" free\" : \" true\" ,\n \" pages\" : \" 204.04\" \n }" ;
206
- assertEquals (readResultAsString , mapper .writeValueAsString (readResult ));
205
+ String readResultAsString = _unifyLFs ( "{\n \" color\" : \" Black\" ,\n \" free\" : \" true\" ,\n \" pages\" : \" 204.04\" \n }" ) ;
206
+ assertEquals (readResultAsString , _unifyLFs ( mapper .writeValueAsString (readResult ) ));
207
207
208
208
// validate properties
209
209
Boolean mapperConfig1 = mapper ._deserializationConfig .isEnabled (DeserializationFeature .FAIL_ON_NULL_FOR_PRIMITIVES );
@@ -224,6 +224,10 @@ public void testCopyWith() throws Exception {
224
224
);
225
225
}
226
226
227
+ private String _unifyLFs (String doc ) {
228
+ return doc .replaceAll ("[\r \n ]+" , "\n " );
229
+ }
230
+
227
231
public void testFailedCopy () throws Exception
228
232
{
229
233
NoCopyMapper src = new NoCopyMapper ();
You can’t perform that action at this time.
0 commit comments