TestKeyRepeat tests simple key repeat
(t *testing.T)
| 239 | |
| 240 | // TestKeyRepeat tests simple key repeat |
| 241 | func TestKeyRepeat(t *testing.T) { |
| 242 | term := vt.NewMockTerm() |
| 243 | defer MustClose(t, term) |
| 244 | |
| 245 | MustStart(t, term) |
| 246 | |
| 247 | // Keep the initial repeat quick, but make later repeats very slow so the test |
| 248 | // does not depend on sub-100ms timer precision. |
| 249 | term.SetRepeat(time.Millisecond*50, time.Second) |
| 250 | |
| 251 | term.KeyPress(vt.KeyX) |
| 252 | time.Sleep(100 * time.Millisecond) |
| 253 | term.KeyPress(vt.KeyX) |
| 254 | term.KeyRelease(vt.KeyX) |
| 255 | term.KeyRelease(vt.KeyCapsLock) |
| 256 | |
| 257 | CheckRead(t, term, "xx") |
| 258 | } |
| 259 | |
| 260 | // TestKeyRepeatDisabled tests simple key repeat |
| 261 | func TestKeyRepeatDisabled(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…