Skip to content

Commit

Permalink
JSON references which receive a Windows line-ending via git causes te…
Browse files Browse the repository at this point in the history
…st errors (false positves)
  • Loading branch information
svanteschubert authored and mistmist committed Jul 19, 2024
1 parent 8ee02cc commit 40f03dc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ protected String roundtripOperationTest(
if (initialRefOpsFile.exists()) {
String initialRefOps = ResourceUtilities.loadFileAsString(initialRefOpsFile);
LOG.log(Level.FINEST, "The original ops from testFile are:{0}", initialRefOps);
if (!initialTestOps.equals(initialRefOps)) {
if (!initialTestOps.equals(initialRefOps.replaceAll("\\r\\n?", "\n"))) {
LOG.log(Level.SEVERE, "Ups! The original ops from testFile had been:{0}", initialRefOps);
LOG.log(Level.SEVERE, "But The new ops from testFile are :{0}", initialTestOps);
initialComparisonFailure = true;
Expand Down Expand Up @@ -615,7 +615,7 @@ private boolean reloadDocument(
// character for list bullets
if (!JsonOperationNormalizer.asString(reloadedOps, Boolean.TRUE)
.replace(",{\"name\"", ",\n{\"name\"")
.equals(referenceOpsFromFile)) {
.equals(referenceOpsFromFile.replaceAll("\\r\\n?", "\n"))) {
LOG.log(Level.SEVERE, "The reference ops are:{0}", referenceOpsFromFile);
reloadedComparisonFailure = true;
}
Expand Down

0 comments on commit 40f03dc

Please sign in to comment.