TestKeyRepeatCapsLock ensures that caps lock does not repeat
(t *testing.T)
| 279 | |
| 280 | // TestKeyRepeatCapsLock ensures that caps lock does not repeat |
| 281 | func TestKeyRepeatCapsLock(t *testing.T) { |
| 282 | term := vt.NewMockTerm() |
| 283 | defer MustClose(t, term) |
| 284 | |
| 285 | MustStart(t, term) |
| 286 | |
| 287 | // Use a large repeat interval so the test is not sitting on a timing boundary. |
| 288 | // We only need to prove that caps lock does not emit its own repeat. |
| 289 | term.SetRepeat(time.Millisecond*50, time.Millisecond*250) |
| 290 | |
| 291 | term.KeyPress(vt.KeyCapsLock) |
| 292 | term.KeyPress(vt.KeyZ) |
| 293 | time.Sleep(90 * time.Millisecond) |
| 294 | term.KeyPress(vt.KeyZ) |
| 295 | term.KeyRelease(vt.KeyZ) |
| 296 | term.KeyRelease(vt.KeyCapsLock) |
| 297 | |
| 298 | CheckRead(t, term, "ZZ") // 0 ms, 50 ms |
| 299 | } |
| 300 | |
| 301 | // TestKeyRepeatNoAlt ensures that alt keys do not repeat |
| 302 | func TestKeyRepeatNoAlt(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…