Skip to content

Commit

Permalink
Adapt tests to windows newline
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada committed May 5, 2024
1 parent e97ab75 commit 8537d7f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

class StringRegexpMatcherTest
{
private static final String NL = System.lineSeparator();

@Test
void testMatches()
{
Expand All @@ -26,7 +28,7 @@ void testDoesNotMatch()
{
final StringRegexpMatcher matcher = new StringRegexpMatcher("a.c");
final AssertionError error = assertThrows(AssertionError.class, () -> assertThat("ac", matcher));
assertThat(error.getMessage(), equalTo("\nExpected: a string contains regexp \"a.c\"\n" + //
assertThat(error.getMessage(), equalTo(NL + "Expected: a string contains regexp \"a.c\"" + NL + //
" but: was \"ac\""));
}

Expand All @@ -35,7 +37,7 @@ void testMatchesCase()
{
final StringRegexpMatcher matcher = new StringRegexpMatcher("abc");
final AssertionError error = assertThrows(AssertionError.class, () -> assertThat("aBc", matcher));
assertThat(error.getMessage(), equalTo("\nExpected: a string contains regexp \"abc\"\n" + //
assertThat(error.getMessage(), equalTo(NL + "Expected: a string contains regexp \"abc\"" + NL + //
" but: was \"aBc\""));
}
}

0 comments on commit 8537d7f

Please sign in to comment.