TestKeyRepeatShift ensures that shifted keys still work as long as repeat is held down.
(t *testing.T)
| 321 | |
| 322 | // TestKeyRepeatShift ensures that shifted keys still work as long as repeat is held down. |
| 323 | func TestKeyRepeatShift(t *testing.T) { |
| 324 | term := vt.NewMockTerm() |
| 325 | defer MustClose(t, term) |
| 326 | |
| 327 | MustStart(t, term) |
| 328 | |
| 329 | // Use a large repeat interval so the test is not sitting on a timing boundary. |
| 330 | // We only need to prove that shifted keys keep their shifted value while repeating. |
| 331 | term.SetRepeat(time.Millisecond*50, time.Millisecond*250) |
| 332 | |
| 333 | term.KeyPress(vt.KeyLShift) |
| 334 | term.KeyPress(vt.Key1) |
| 335 | time.Sleep(90 * time.Millisecond) |
| 336 | term.KeyPress(vt.Key1) |
| 337 | term.KeyRelease(vt.Key1) |
| 338 | term.KeyRelease(vt.KeyLShift) |
| 339 | |
| 340 | CheckRead(t, term, "!!") // 0 ms, 50 ms |
| 341 | } |
| 342 | |
| 343 | // TestKeyRepeatShiftRelease ensures that releasing shift breaks repeat. |
| 344 | func TestKeyRepeatShiftRelease(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…