File tree 1 file changed +18
-1
lines changed
terminal/src/test/java/org/jline/utils
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,24 @@ public void testBold() throws IOException {
52
52
53
53
assertEquals ("\33 [32;1mtest\33 [0m" , AttributedString .fromAnsi ("\33 [32m\33 [1mtest\33 [0m" ).toAnsi (terminal ));
54
54
assertEquals ("\33 [32;1mtest\33 [0m" , AttributedString .fromAnsi ("\33 [1m\33 [32mtest\33 [0m" ).toAnsi (terminal ));
55
-
56
55
}
57
56
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
+ }
58
75
}
You can’t perform that action at this time.
0 commit comments