TestKeyRepeatNoAlt ensures that alt keys do not repeat
(t *testing.T)
| 300 | |
| 301 | // TestKeyRepeatNoAlt ensures that alt keys do not repeat |
| 302 | func TestKeyRepeatNoAlt(t *testing.T) { |
| 303 | term := vt.NewMockTerm() |
| 304 | defer MustClose(t, term) |
| 305 | |
| 306 | MustStart(t, term) |
| 307 | |
| 308 | // Keep the initial repeat quick, but make later repeats very slow so the test |
| 309 | // does not sit on a timer boundary. |
| 310 | term.SetRepeat(time.Millisecond*50, time.Second) |
| 311 | |
| 312 | term.KeyPress(vt.KeyLAlt) |
| 313 | term.KeyPress(vt.KeyZ) |
| 314 | time.Sleep(100 * time.Millisecond) |
| 315 | term.KeyPress(vt.KeyZ) |
| 316 | term.KeyRelease(vt.KeyZ) |
| 317 | term.KeyRelease(vt.KeyLAlt) |
| 318 | |
| 319 | CheckRead(t, term, "\x1bz") |
| 320 | } |
| 321 | |
| 322 | // TestKeyRepeatShift ensures that shifted keys still work as long as repeat is held down. |
| 323 | func TestKeyRepeatShift(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…