Skip to content

Commit

Permalink
fix(test): Windows line endings comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
kris7t committed Apr 7, 2024
1 parent be3c99a commit 064c48a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ void loadScopeConstraintsTest(String originalScopes, List<String> scopes, List<S
modifiedProblem.eResource().save(outputStream, Map.of());
serializedProblem = outputStream.toString(StandardCharsets.UTF_8);
}
assertThat(serializedProblem, is(PREFIX + expectedScopes));
var normalizedResult = serializedProblem.replace("\r\n", "\n");
var normalizedExpected = (PREFIX + expectedScopes).formatted("\r\n", "\n");
assertThat(normalizedResult, is(normalizedExpected));
}

static Stream<Arguments> loadScopeConstraintsTest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ void solutionSerializerTest(String prefix, String input, String expectedOutput)
solution.eResource().save(outputStream, Map.of());
actualOutput = outputStream.toString();
}
assertThat(actualOutput, is(prefix + "\n" + expectedOutput));
var normalizedResult = actualOutput.replace("\r\n", "\n");
var normalizedExpected = (prefix + "\n" + expectedOutput).replace("\r\n", "\n");
assertThat(normalizedResult, is(normalizedExpected));
}

static Stream<Arguments> solutionSerializerTest() {
Expand Down

0 comments on commit 064c48a

Please sign in to comment.