| 1 | package ansi_test |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/charmbracelet/x/ansi" |
| 7 | ) |
| 8 | |
| 9 | func TestSetIconNameWindowTitle(t *testing.T) { |
| 10 | if ansi.SetIconNameWindowTitle("hello") != "\x1b]0;hello\x07" { |
| 11 | t.Errorf("expected: %q, got: %q", "\x1b]0;hello\x07", ansi.SetIconNameWindowTitle("hello")) |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | func TestSetIconName(t *testing.T) { |
| 16 | if ansi.SetIconName("hello") != "\x1b]1;hello\x07" { |
| 17 | t.Errorf("expected: %q, got: %q", "\x1b]1;hello\x07", ansi.SetIconName("hello")) |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | func TestSetWindowTitle(t *testing.T) { |
| 22 | if ansi.SetWindowTitle("hello") != "\x1b]2;hello\x07" { |
| 23 | t.Errorf("expected: %q, got: %q", "\x1b]2;hello\x07", ansi.SetWindowTitle("hello")) |
| 24 | } |
| 25 | } |