This is an automated email from the ASF dual-hosted git repository.
Harbs pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
The following commit(s) were added to refs/heads/develop by this push:
new f9a54902e feat(codegraph): Normalize line endings in test assertions
and add helper method
f9a54902e is described below
commit f9a54902e4189fb5ccbd1bc391047141d6c593e6
Author: Harbs <[email protected]>
AuthorDate: Mon Aug 3 17:30:43 2026 +0300
feat(codegraph): Normalize line endings in test assertions and add helper
method
---
.../java/org/apache/royale/compiler/clients/TestCODEGRAPH.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git
a/compiler-jx/src/test/java/org/apache/royale/compiler/clients/TestCODEGRAPH.java
b/compiler-jx/src/test/java/org/apache/royale/compiler/clients/TestCODEGRAPH.java
index 8d8d0d70b..1319c4eec 100644
---
a/compiler-jx/src/test/java/org/apache/royale/compiler/clients/TestCODEGRAPH.java
+++
b/compiler-jx/src/test/java/org/apache/royale/compiler/clients/TestCODEGRAPH.java
@@ -111,9 +111,11 @@ public class TestCODEGRAPH
String secondOutput = FileUtils.readFileToString(outputFile, "UTF-8");
assertEquals(firstOutput, secondOutput);
+ assertFalse(firstOutput.contains("\r"));
File goldenFile = new File(sourceDirectory,
"codegraph/golden/GraphRoot.json");
- String goldenOutput = FileUtils.readFileToString(goldenFile, "UTF-8");
+ String goldenOutput =
normalizeLineEndings(FileUtils.readFileToString(goldenFile, "UTF-8"));
assertEquals(goldenOutput, firstOutput);
+ assertEquals(goldenOutput,
normalizeLineEndings(goldenOutput.replace("\n", "\r\n")));
}
@Test
@@ -209,6 +211,11 @@ public class TestCODEGRAPH
return false;
}
+ private String normalizeLineEndings(String value)
+ {
+ return value.replace("\r\n", "\n").replace('\r', '\n');
+ }
+
private int compile(File sourceFile, File sourceDirectory, boolean
createTargetWithErrors)
{
return compile(sourceFile, sourceDirectory, createTargetWithErrors,
null);