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

Function TestKeyRepeatCapsLock

vt/tests/key_test.go:281–299  ·  view source on GitHub ↗

TestKeyRepeatCapsLock ensures that caps lock does not repeat

(t *testing.T)

Source from the content-addressed store, hash-verified

279
280// TestKeyRepeatCapsLock ensures that caps lock does not repeat
281func 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
302func TestKeyRepeatNoAlt(t *testing.T) {

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…