gilo/internal/terminal/ansi_test.go

24 lines
409 B
Go
Raw Normal View History

2021-03-30 19:37:02 -04:00
package terminal
import "testing"
func TestCode(t *testing.T) {
input := "H"
got := Code(input)
want := EscPrefix + input
if got != want {
t.Errorf("Failed to prefix %q with the escape prefix: %q", input, EscPrefix)
}
}
func TestMoveCursor(t *testing.T) {
got := MoveCursor(0, 0)
want := Code("%d;%dH", 1, 1)
if got != want {
t.Errorf("Failed to create escape sequence to move cursor")
}
2021-04-01 16:17:13 -04:00
}