Skip to content

Commit 3b25fc7

Browse files
authored
Merge pull request #18 from Zim-Inn/patch-1
Enhance the compatibility of unit testing
2 parents d220224 + ed59971 commit 3b25fc7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/test/java/de/marhali/json5/TestJson5.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ private String getTestResourceContent(String fileName) throws IOException {
4545
buf.write((byte) result);
4646
}
4747

48-
return buf.toString(StandardCharsets.UTF_8);
48+
return Optional.ofNullable(buf.toString(StandardCharsets.UTF_8))
49+
.map(s->s.replace("\r\n","\n"))
50+
.map(s->s.replace("\r","\n"))
51+
.orElse(null);
4952
}
5053
}
5154

0 commit comments

Comments
 (0)