| 1 | package ansi_test |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/charmbracelet/x/ansi" |
| 7 | ) |
| 8 | |
| 9 | func TestNotifyWorkingDirectory_LocalFile(t *testing.T) { |
| 10 | h := ansi.NotifyWorkingDirectory("localhost", "path", "to", "file") |
| 11 | if h != "\x1b]7;file://localhost/path/to/file\x07" { |
| 12 | t.Errorf("Unexpected url: %s", h) |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | func TestNotifyWorkingDirectory_RemoteFile(t *testing.T) { |
| 17 | h := ansi.NotifyWorkingDirectory("example.com", "path", "to", "file") |
| 18 | if h != "\x1b]7;file://example.com/path/to/file\x07" { |
| 19 | t.Errorf("Unexpected url: %s", h) |
| 20 | } |
| 21 | } |