File: cwd_test.go

package info (click to toggle)
golang-github-charmbracelet-x 0.0~git20251028.0cf22f8%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,940 kB
  • sloc: sh: 124; makefile: 5
file content (21 lines) | stat: -rw-r--r-- 528 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package ansi_test

import (
	"testing"

	"github.com/charmbracelet/x/ansi"
)

func TestNotifyWorkingDirectory_LocalFile(t *testing.T) {
	h := ansi.NotifyWorkingDirectory("localhost", "path", "to", "file")
	if h != "\x1b]7;file://localhost/path/to/file\x07" {
		t.Errorf("Unexpected url: %s", h)
	}
}

func TestNotifyWorkingDirectory_RemoteFile(t *testing.T) {
	h := ansi.NotifyWorkingDirectory("example.com", "path", "to", "file")
	if h != "\x1b]7;file://example.com/path/to/file\x07" {
		t.Errorf("Unexpected url: %s", h)
	}
}