MCPcopy
hub / github.com/gdamore/tcell / TestKeyRepeatDisabled

Function TestKeyRepeatDisabled

vt/tests/key_test.go:261–278  ·  view source on GitHub ↗

TestKeyRepeatDisabled tests simple key repeat

(t *testing.T)

Source from the content-addressed store, hash-verified

259
260// TestKeyRepeatDisabled tests simple key repeat
261func 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
281func TestKeyRepeatCapsLock(t *testing.T) {

Callers

nothing calls this directly

Calls 8

SetRepeatMethod · 0.95
KeyPressMethod · 0.95
KeyReleaseMethod · 0.95
NewMockTermFunction · 0.92
MustCloseFunction · 0.85
MustStartFunction · 0.85
WriteFFunction · 0.85
CheckReadFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…