Skip to content

Commit

Permalink
Try fixing #4168 wrt linefeed diff
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Oct 23, 2023
1 parent a1b7557 commit 5ecb5d7
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ public void testCopyWith() throws JsonProcessingException {
assertEquals("Black", readResult.get("color").asText());
assertEquals(true, readResult.get("free").asBoolean());
assertEquals(204, readResult.get("pages").asInt());
String readResultAsString = "{\n \"color\" : \"Black\",\n \"free\" : \"true\",\n \"pages\" : \"204.04\"\n}";
assertEquals(readResultAsString, mapper.writeValueAsString(readResult));
String readResultAsString = _unifyLFs("{\n \"color\" : \"Black\",\n \"free\" : \"true\",\n \"pages\" : \"204.04\"\n}");
assertEquals(readResultAsString, _unifyLFs(mapper.writeValueAsString(readResult)));

// validate properties
Boolean mapperConfig1 = mapper._deserializationConfig.isEnabled(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES);
Expand All @@ -243,6 +243,10 @@ public void testCopyWith() throws JsonProcessingException {
);
}

private String _unifyLFs(String doc) {
return doc.replaceAll("[\r\n]+", "\n");
}

public void testFailedCopy() throws Exception
{
NoCopyMapper src = new NoCopyMapper();
Expand Down

0 comments on commit 5ecb5d7

Please sign in to comment.