Skip to content

Commit a0b4cde

Browse files
committed
Make line ending expectations in TotalProgressBarTests OS-independent
See gh-19828
1 parent c1ebd5a commit a0b4cde

File tree

1 file changed

+4
-3
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker

1 file changed

+4
-3
lines changed

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/TotalProgressBarTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ void withPrefixAndBookends() {
4040
bar.accept(new TotalProgressEvent(50));
4141
assertThat(out.toString()).isEqualTo("prefix: [ #########################");
4242
bar.accept(new TotalProgressEvent(100));
43-
assertThat(out.toString()).isEqualTo("prefix: [ ################################################## ]\n");
43+
assertThat(out.toString())
44+
.isEqualTo(String.format("prefix: [ ################################################## ]%n"));
4445
}
4546

4647
@Test
@@ -53,7 +54,7 @@ void withoutPrefix() {
5354
bar.accept(new TotalProgressEvent(50));
5455
assertThat(out.toString()).isEqualTo("[ #########################");
5556
bar.accept(new TotalProgressEvent(100));
56-
assertThat(out.toString()).isEqualTo("[ ################################################## ]\n");
57+
assertThat(out.toString()).isEqualTo(String.format("[ ################################################## ]%n"));
5758
}
5859

5960
@Test
@@ -66,7 +67,7 @@ void withoutBookends() {
6667
bar.accept(new TotalProgressEvent(50));
6768
assertThat(out.toString()).isEqualTo(".........................");
6869
bar.accept(new TotalProgressEvent(100));
69-
assertThat(out.toString()).isEqualTo("..................................................\n");
70+
assertThat(out.toString()).isEqualTo(String.format("..................................................%n"));
7071
}
7172

7273
static class TestPrintStream extends PrintStream {

0 commit comments

Comments
 (0)