TestKeyRepeatShiftRelease ensures that releasing shift breaks repeat.
(t *testing.T)
| 342 | |
| 343 | // TestKeyRepeatShiftRelease ensures that releasing shift breaks repeat. |
| 344 | func TestKeyRepeatShiftRelease(t *testing.T) { |
| 345 | term := vt.NewMockTerm() |
| 346 | defer MustClose(t, term) |
| 347 | |
| 348 | MustStart(t, term) |
| 349 | |
| 350 | // Use a large repeat interval so the test is not sitting on a timing boundary. |
| 351 | // We only need to prove that releasing shift changes the repeated value. |
| 352 | term.SetRepeat(time.Millisecond*50, time.Millisecond*250) |
| 353 | |
| 354 | term.KeyPress(vt.KeyLShift) |
| 355 | term.KeyPress(vt.Key2) |
| 356 | term.KeyRelease(vt.KeyLShift) |
| 357 | time.Sleep(90 * time.Millisecond) |
| 358 | term.KeyPress(vt.Key2) |
| 359 | term.KeyRelease(vt.Key2) |
| 360 | |
| 361 | CheckRead(t, term, "@2") // 0 ms, 50 ms |
| 362 | } |
| 363 | |
| 364 | func TestKeyRepeatCursor(t *testing.T) { |
| 365 | term := vt.NewMockTerm() |
nothing calls this directly
no test coverage detected
searching dependent graphs…