Skip to content

Commit

Permalink
Automatic code cleanup.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 367157244
  • Loading branch information
Googler authored and copybara-github committed Apr 7, 2021
1 parent 76a8498 commit 74cd105
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ public class LineWrappingAnsiTerminalWriterTest {
@Test
public void testSimpleLineWrapping() throws IOException {
LoggingTerminalWriter terminal = new LoggingTerminalWriter();
(new LineWrappingAnsiTerminalWriter(terminal, 5, '+')).append("abcdefghij");
new LineWrappingAnsiTerminalWriter(terminal, 5, '+').append("abcdefghij");
assertThat(terminal.getTranscript()).isEqualTo("abcd+" + NL + "efgh+" + NL + "ij");
}

@Test
public void testAlwaysWrap() throws IOException {
LoggingTerminalWriter terminal = new LoggingTerminalWriter();
(new LineWrappingAnsiTerminalWriter(terminal, 5, '+')).append("12345").newline();
new LineWrappingAnsiTerminalWriter(terminal, 5, '+').append("12345").newline();
assertThat(terminal.getTranscript()).isEqualTo("1234+" + NL + "5" + NL);
}

@Test
public void testWrapLate() throws IOException {
LoggingTerminalWriter terminal = new LoggingTerminalWriter();
(new LineWrappingAnsiTerminalWriter(terminal, 5, '+')).append("1234");
new LineWrappingAnsiTerminalWriter(terminal, 5, '+').append("1234");
// Lines are only wrapped, once a character is written that cannot fit in the current line, and
// not already once the last usable character of a line is used. Hence, in this example, we do
// not want to see the continuation character.
Expand All @@ -57,14 +57,14 @@ public void testWrapLate() throws IOException {
@Test
public void testNewlineTranslated() throws IOException {
LoggingTerminalWriter terminal = new LoggingTerminalWriter();
(new LineWrappingAnsiTerminalWriter(terminal, 80, '+')).append("foo\nbar\n");
new LineWrappingAnsiTerminalWriter(terminal, 80, '+').append("foo\nbar\n");
assertThat(terminal.getTranscript()).isEqualTo("foo" + NL + "bar" + NL);
}

@Test
public void testNewlineResetsCount() throws IOException {
LoggingTerminalWriter terminal = new LoggingTerminalWriter();
(new LineWrappingAnsiTerminalWriter(terminal, 5, '+'))
new LineWrappingAnsiTerminalWriter(terminal, 5, '+')
.append("123")
.newline()
.append("abc")
Expand All @@ -78,7 +78,7 @@ public void testNewlineResetsCount() throws IOException {
@Test
public void testEventsPassedThrough() throws IOException {
LoggingTerminalWriter terminal = new LoggingTerminalWriter();
(new LineWrappingAnsiTerminalWriter(terminal, 80, '+'))
new LineWrappingAnsiTerminalWriter(terminal, 80, '+')
.okStatus()
.append("ok")
.failStatus()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ public Object call() throws Exception {
case 4:
out = streams[random.nextInt(3)];
break;
}
default: // fall out
}
}
return null;
}
Expand Down

0 comments on commit 74cd105

Please sign in to comment.