okami.mom/ultraviolet

git clone https://git.nkp.pet/okami.mom/ultraviolet

Ayman Bagabaschore: add cursor shape tests25e48a6

main
530 B26 linesraw
1package uv
2
3import "testing"
4
5func TestCursorShape_Encode(t *testing.T) {
6	tests := []struct {
7		shape   CursorShape
8		blink   bool
9		wantEnc int
10	}{
11		{CursorBlock, true, 1},
12		{CursorBlock, false, 2},
13		{CursorUnderline, true, 3},
14		{CursorUnderline, false, 4},
15		{CursorBar, true, 5},
16		{CursorBar, false, 6},
17	}
18
19	for _, tt := range tests {
20		t.Run("", func(t *testing.T) {
21			if gotEnc := tt.shape.Encode(tt.blink); gotEnc != tt.wantEnc {
22				t.Errorf("CursorShape.Encode() = %v, want %v", gotEnc, tt.wantEnc)
23			}
24		})
25	}
26}