Skip to content

Commit 43b6eba

Browse files
authored
Handle newlines in release notes test (elastic#130134) (elastic#130353)
Newlines are system dependent. The release notes generator uses groovy's template engine, which produces system dependent newlines. This commit adjusts the test to account for newlines on both windows and nix systems.
1 parent c02df81 commit 43b6eba

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/release/ReleaseNotesGeneratorTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import java.util.Objects;
2121
import java.util.Set;
2222

23-
import static org.hamcrest.Matchers.equalTo;
23+
import static org.hamcrest.Matchers.arrayContaining;
2424
import static org.junit.Assert.assertThat;
2525

2626
public class ReleaseNotesGeneratorTest {
@@ -42,7 +42,10 @@ public void generateFile_rendersCorrectMarkup() throws Exception {
4242
final String actualOutput = ReleaseNotesGenerator.generateFile(template, QualifiedVersion.of("8.2.0-SNAPSHOT"), entries);
4343

4444
// then:
45-
assertThat(actualOutput, equalTo(expectedOutput));
45+
String[] expectedLines = expectedOutput.replace("\r", "").split("\n");
46+
String[] actualLines = actualOutput.split("\n");
47+
48+
assertThat(actualLines, arrayContaining(expectedLines));
4649
}
4750

4851
private Set<ChangelogEntry> getEntries() {

0 commit comments

Comments
 (0)