TestKeyRepeatDisabled tests simple key repeat
(t *testing.T)
| 259 | |
| 260 | // TestKeyRepeatDisabled tests simple key repeat |
| 261 | func TestKeyRepeatDisabled(t *testing.T) { |
| 262 | term := vt.NewMockTerm() |
| 263 | defer MustClose(t, term) |
| 264 | |
| 265 | MustStart(t, term) |
| 266 | |
| 267 | // Keep the initial repeat quick, but make later repeats very slow so the test |
| 268 | // only needs to distinguish repeated from non-repeated input. |
| 269 | term.SetRepeat(time.Millisecond*50, time.Second) |
| 270 | WriteF(t, term, "\x1b[?8l") |
| 271 | |
| 272 | term.KeyPress(vt.KeyX) |
| 273 | time.Sleep(100 * time.Millisecond) |
| 274 | term.KeyPress(vt.KeyX) |
| 275 | term.KeyRelease(vt.KeyX) |
| 276 | |
| 277 | CheckRead(t, term, "x") |
| 278 | } |
| 279 | |
| 280 | // TestKeyRepeatCapsLock ensures that caps lock does not repeat |
| 281 | func TestKeyRepeatCapsLock(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…