diff options
author | Kristóf Marussy <kristof@marussy.com> | 2024-04-07 14:09:34 +0200 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2024-04-07 14:42:15 +0200 |
commit | 064c48a795011d01c1b2c50d7e033031e9d5d3a7 (patch) | |
tree | ae6c5f13b45e23a7d45d95695180d82356d9f199 | |
parent | build: multi-platform build (diff) | |
download | refinery-064c48a795011d01c1b2c50d7e033031e9d5d3a7.tar.gz refinery-064c48a795011d01c1b2c50d7e033031e9d5d3a7.tar.zst refinery-064c48a795011d01c1b2c50d7e033031e9d5d3a7.zip |
fix(test): Windows line endings comparison
2 files changed, 6 insertions, 2 deletions
diff --git a/subprojects/generator/src/test/java/tools/refinery/generator/ProblemLoaderTest.java b/subprojects/generator/src/test/java/tools/refinery/generator/ProblemLoaderTest.java index 0c0db105..f0b546d7 100644 --- a/subprojects/generator/src/test/java/tools/refinery/generator/ProblemLoaderTest.java +++ b/subprojects/generator/src/test/java/tools/refinery/generator/ProblemLoaderTest.java | |||
@@ -47,7 +47,9 @@ class ProblemLoaderTest { | |||
47 | modifiedProblem.eResource().save(outputStream, Map.of()); | 47 | modifiedProblem.eResource().save(outputStream, Map.of()); |
48 | serializedProblem = outputStream.toString(StandardCharsets.UTF_8); | 48 | serializedProblem = outputStream.toString(StandardCharsets.UTF_8); |
49 | } | 49 | } |
50 | assertThat(serializedProblem, is(PREFIX + expectedScopes)); | 50 | var normalizedResult = serializedProblem.replace("\r\n", "\n"); |
51 | var normalizedExpected = (PREFIX + expectedScopes).formatted("\r\n", "\n"); | ||
52 | assertThat(normalizedResult, is(normalizedExpected)); | ||
51 | } | 53 | } |
52 | 54 | ||
53 | static Stream<Arguments> loadScopeConstraintsTest() { | 55 | static Stream<Arguments> loadScopeConstraintsTest() { |
diff --git a/subprojects/language-semantics/src/test/java/tools/refinery/language/semantics/SolutionSerializerTest.java b/subprojects/language-semantics/src/test/java/tools/refinery/language/semantics/SolutionSerializerTest.java index be675a80..9f36445a 100644 --- a/subprojects/language-semantics/src/test/java/tools/refinery/language/semantics/SolutionSerializerTest.java +++ b/subprojects/language-semantics/src/test/java/tools/refinery/language/semantics/SolutionSerializerTest.java | |||
@@ -72,7 +72,9 @@ class SolutionSerializerTest { | |||
72 | solution.eResource().save(outputStream, Map.of()); | 72 | solution.eResource().save(outputStream, Map.of()); |
73 | actualOutput = outputStream.toString(); | 73 | actualOutput = outputStream.toString(); |
74 | } | 74 | } |
75 | assertThat(actualOutput, is(prefix + "\n" + expectedOutput)); | 75 | var normalizedResult = actualOutput.replace("\r\n", "\n"); |
76 | var normalizedExpected = (prefix + "\n" + expectedOutput).replace("\r\n", "\n"); | ||
77 | assertThat(normalizedResult, is(normalizedExpected)); | ||
76 | } | 78 | } |
77 | 79 | ||
78 | static Stream<Arguments> solutionSerializerTest() { | 80 | static Stream<Arguments> solutionSerializerTest() { |