You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ss...@apache.org on 2025/02/24 18:54:05 UTC
(sling-org-apache-sling-repoinit-parser) 01/01: SLING-12669 Fix unit test failure on Windows
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch feature/SLING-12669-unittests-windows
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git
commit 9cbb545ce76dc484a3a5335f9ed51ddc37570489
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Mon Feb 24 19:53:55 2025 +0100
SLING-12669 Fix unit test failure on Windows
---
.../apache/sling/repoinit/parser/test/ParserTestCase.java | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/test/java/org/apache/sling/repoinit/parser/test/ParserTestCase.java b/src/test/java/org/apache/sling/repoinit/parser/test/ParserTestCase.java
index 0dbf7c7..0fee00a 100644
--- a/src/test/java/org/apache/sling/repoinit/parser/test/ParserTestCase.java
+++ b/src/test/java/org/apache/sling/repoinit/parser/test/ParserTestCase.java
@@ -100,16 +100,20 @@ public class ParserTestCase implements Closeable {
}
sw.flush();
String actual = sw.toString().trim();
-
- // normalize line endings to ensure tests run on windows as well
- actual = actual.replaceAll("\r\n", "\n");
-
- assertEquals(expected, actual);
+
+ assertEquals(normalizeLineEndings(expected), normalizeLineEndings(actual));
} finally {
toClose.close();
}
}
+ /**
+ * Normalize line endings to ensure tests run on windows as well
+ */
+ private static String normalizeLineEndings(String s) {
+ return s.replaceAll("\r\n", "\n");
+ }
+
public static Collection<Object[]> buildTestData() throws IOException {
final List<Object []> result = new ArrayList<>();
for(int i=0; i <= MAX_TEST_INDEX; i++) {