Skip to content

Commit 64fc2f2

Browse files
committedMar 6, 2023
Add a test for #i805
1 parent caa2d14 commit 64fc2f2

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed
 

‎terminal/src/test/java/org/jline/utils/AttributedCharSequenceTest.java

+18-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,24 @@ public void testBold() throws IOException {
5252

5353
assertEquals("\33[32;1mtest\33[0m", AttributedString.fromAnsi("\33[32m\33[1mtest\33[0m").toAnsi(terminal));
5454
assertEquals("\33[32;1mtest\33[0m", AttributedString.fromAnsi("\33[1m\33[32mtest\33[0m").toAnsi(terminal));
55-
5655
}
5756

57+
@Test
58+
public void testRoundTrip() throws IOException {
59+
ExternalTerminal terminal = new ExternalTerminal(
60+
"my term",
61+
"xterm",
62+
new ByteArrayInputStream(new byte[0]),
63+
new ByteArrayOutputStream(),
64+
StandardCharsets.UTF_8);
65+
66+
67+
AttributedString org = new AttributedStringBuilder()
68+
.append("─")
69+
.toAttributedString();
70+
71+
AttributedString rndTrip = AttributedString.fromAnsi(org.toAnsi(terminal));
72+
73+
assertEquals(org, rndTrip);
74+
}
5875
}

0 commit comments

Comments
 (0)
Please sign in to comment.