diff options
Diffstat (limited to 'lib/parse/ansi_test.go')
-rw-r--r-- | lib/parse/ansi_test.go | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/lib/parse/ansi_test.go b/lib/parse/ansi_test.go index f916412b..6aa95b18 100644 --- a/lib/parse/ansi_test.go +++ b/lib/parse/ansi_test.go @@ -26,49 +26,49 @@ func TestParser(t *testing.T) { { name: "bold", input: "\x1b[1mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[1mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[1mhello, world\x1b[m", expectedLen: 12, }, { name: "dim", input: "\x1b[2mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[2mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[2mhello, world\x1b[m", expectedLen: 12, }, { name: "bold and dim", input: "\x1b[1;2mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[1m\x1b[2mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[1m\x1b[2mhello, world\x1b[m", expectedLen: 12, }, { name: "italic", input: "\x1b[3mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[3mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[3mhello, world\x1b[m", expectedLen: 12, }, { name: "underline", input: "\x1b[4mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[4mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[4mhello, world\x1b[m", expectedLen: 12, }, { name: "blink", input: "\x1b[5mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[5mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[5mhello, world\x1b[m", expectedLen: 12, }, { name: "fast blink", input: "\x1b[6mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[5mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[5mhello, world\x1b[m", expectedLen: 12, }, { name: "reverse", input: "\x1b[7mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[7mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[7mhello, world\x1b[m", expectedLen: 12, }, { @@ -80,121 +80,121 @@ func TestParser(t *testing.T) { { name: "strikethrough", input: "\x1b[9mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[9mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[9mhello, world\x1b[m", expectedLen: 12, }, { name: "bold hello, normal world", input: "\x1b[1mhello, \x1b[21mworld", - expectedString: "\x1b(B\x1b[m\x1b[1mhello, \x1b(B\x1b[mworld\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[1mhello, \x1b[mworld\x1b[m", expectedLen: 12, }, { name: "bold hello, normal world v2", input: "\x1b[1mhello, \x1b[mworld", - expectedString: "\x1b(B\x1b[m\x1b[1mhello, \x1b(B\x1b[mworld\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[1mhello, \x1b[mworld\x1b[m", expectedLen: 12, }, { name: "8 bit color: foreground", input: "\x1b[30mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[30mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[38;5;0mhello, world\x1b[m", expectedLen: 12, }, { name: "8 bit color: background", input: "\x1b[41mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[41mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[48;5;1mhello, world\x1b[m", expectedLen: 12, }, { name: "8 bit color: foreground and background", input: "\x1b[31;41mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[31;41mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[38;5;1;48;5;1mhello, world\x1b[m", expectedLen: 12, }, { name: "16 bit color: foreground", input: "\x1b[90mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[90mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[38;5;8mhello, world\x1b[m", expectedLen: 12, }, { name: "16 bit color: background", input: "\x1b[101mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[101mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[48;5;9mhello, world\x1b[m", expectedLen: 12, }, { name: "16 bit color: foreground and background", input: "\x1b[91;101mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[91;101mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[38;5;9;48;5;9mhello, world\x1b[m", expectedLen: 12, }, { name: "256 color: foreground", input: "\x1b[38;5;2mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[32mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[38;5;2mhello, world\x1b[m", expectedLen: 12, }, { name: "256 color: foreground", input: "\x1b[38;5;132mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[38;5;132mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[38;5;132mhello, world\x1b[m", expectedLen: 12, }, { name: "256 color: background", input: "\x1b[48;5;132mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[48;5;132mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[48;5;132mhello, world\x1b[m", expectedLen: 12, }, { name: "256 color: foreground and background", input: "\x1b[38;5;20;48;5;20mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[38;5;20;48;5;20mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[38;5;20;48;5;20mhello, world\x1b[m", expectedLen: 12, }, { name: "256 color: background", input: "\x1b[48;5;2mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[42mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[48;5;2mhello, world\x1b[m", expectedLen: 12, }, { name: "true color: foreground", input: "\x1b[38;2;0;0;0mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[38;2;0;0;0mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[38;2;0;0;0mhello, world\x1b[m", expectedLen: 12, }, { name: "true color: foreground with color space", input: "\x1b[38;2;;0;0;0mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[38;2;0;0;0mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[38;2;0;0;0mhello, world\x1b[m", expectedLen: 12, }, { name: "true color: foreground with color space and colons", input: "\x1b[38:2::0:0:0mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[38;2;0;0;0mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[38;2;0;0;0mhello, world\x1b[m", expectedLen: 12, }, { name: "true color: background", input: "\x1b[48;2;0;0;0mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[48;2;0;0;0mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[48;2;0;0;0mhello, world\x1b[m", expectedLen: 12, }, { name: "true color: background with color space", input: "\x1b[48;2;;0;0;0mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[48;2;0;0;0mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[48;2;0;0;0mhello, world\x1b[m", expectedLen: 12, }, { name: "true color: foreground and background", input: "\x1b[38;2;200;200;200;48;2;0;0;0mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[38;2;200;200;200;48;2;0;0;0mhello, world\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[38;2;200;200;200;48;2;0;0;0mhello, world\x1b[m", expectedLen: 12, }, } @@ -222,7 +222,7 @@ func TestTruncate(t *testing.T) { { name: "bold, truncate at 5", input: "\x1b[1mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[1mhello\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[1mhello\x1b[m", }, } @@ -249,7 +249,7 @@ func TestTruncateHead(t *testing.T) { { name: "bold, truncate head at 5", input: "\x1b[1mhello, world", - expectedString: "\x1b(B\x1b[m\x1b[1mworld\x1b(B\x1b[m", + expectedString: "\x1b[m\x1b[1mworld\x1b[m", }, } |