Skip to content

Commit

Permalink
Add a test for #i805
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Mar 6, 2023
1 parent caa2d14 commit 64fc2f2
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,24 @@ public void testBold() throws IOException {

assertEquals("\33[32;1mtest\33[0m", AttributedString.fromAnsi("\33[32m\33[1mtest\33[0m").toAnsi(terminal));
assertEquals("\33[32;1mtest\33[0m", AttributedString.fromAnsi("\33[1m\33[32mtest\33[0m").toAnsi(terminal));

}

@Test
public void testRoundTrip() throws IOException {
ExternalTerminal terminal = new ExternalTerminal(
"my term",
"xterm",
new ByteArrayInputStream(new byte[0]),
new ByteArrayOutputStream(),
StandardCharsets.UTF_8);


AttributedString org = new AttributedStringBuilder()
.append("─")
.toAttributedString();

AttributedString rndTrip = AttributedString.fromAnsi(org.toAnsi(terminal));

assertEquals(org, rndTrip);
}
}

0 comments on commit 64fc2f2

Please sign in to comment.