File: title_test.go

package info (click to toggle)
golang-github-charmbracelet-x 0.0~git20240809.9ab0ca0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,004 kB
  • sloc: sh: 55; makefile: 5
file content (25 lines) | stat: -rw-r--r-- 659 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
22
23
24
25
package ansi_test

import (
	"testing"

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

func TestSetIconNameWindowTitle(t *testing.T) {
	if ansi.SetIconNameWindowTitle("hello") != "\x1b]0;hello\x07" {
		t.Errorf("expected: %q, got: %q", "\x1b]0;hello\x07", ansi.SetIconNameWindowTitle("hello"))
	}
}

func TestSetIconName(t *testing.T) {
	if ansi.SetIconName("hello") != "\x1b]1;hello\x07" {
		t.Errorf("expected: %q, got: %q", "\x1b]1;hello\x07", ansi.SetIconName("hello"))
	}
}

func TestSetWindowTitle(t *testing.T) {
	if ansi.SetWindowTitle("hello") != "\x1b]2;hello\x07" {
		t.Errorf("expected: %q, got: %q", "\x1b]2;hello\x07", ansi.SetWindowTitle("hello"))
	}
}