File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/test/java/com/fasterxml/jackson/databind Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -221,8 +221,8 @@ public void testCopyWith() throws JsonProcessingException {
221221 assertEquals ("Black" , readResult .get ("color" ).asText ());
222222 assertEquals (true , readResult .get ("free" ).asBoolean ());
223223 assertEquals (204 , readResult .get ("pages" ).asInt ());
224- String readResultAsString = "{\n \" color\" : \" Black\" ,\n \" free\" : \" true\" ,\n \" pages\" : \" 204.04\" \n }" ;
225- assertEquals (readResultAsString , mapper .writeValueAsString (readResult ));
224+ String readResultAsString = _unifyLFs ( "{\n \" color\" : \" Black\" ,\n \" free\" : \" true\" ,\n \" pages\" : \" 204.04\" \n }" ) ;
225+ assertEquals (readResultAsString , _unifyLFs ( mapper .writeValueAsString (readResult ) ));
226226
227227 // validate properties
228228 Boolean mapperConfig1 = mapper ._deserializationConfig .isEnabled (DeserializationFeature .FAIL_ON_NULL_FOR_PRIMITIVES );
@@ -243,6 +243,10 @@ public void testCopyWith() throws JsonProcessingException {
243243 );
244244 }
245245
246+ private String _unifyLFs (String doc ) {
247+ return doc .replaceAll ("[\r \n ]+" , "\n " );
248+ }
249+
246250 public void testFailedCopy () throws Exception
247251 {
248252 NoCopyMapper src = new NoCopyMapper ();
You can’t perform that action at this time.
0 commit comments