input/focus_test.go
raw| 1 | package input |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | ) |
| 6 | |
| 7 | func TestFocus(t *testing.T) { |
| 8 | var p Parser |
| 9 | _, e := p.parseSequence([]byte("\x1b[I")) |
| 10 | switch e.(type) { |
| 11 | case FocusEvent: |
| 12 | // ok |
| 13 | default: |
| 14 | t.Error("invalid sequence") |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | func TestBlur(t *testing.T) { |
| 19 | var p Parser |
| 20 | _, e := p.parseSequence([]byte("\x1b[O")) |
| 21 | switch e.(type) { |
| 22 | case BlurEvent: |
| 23 | // ok |
| 24 | default: |
| 25 | t.Error("invalid sequence") |
| 26 | } |
| 27 | } |