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

Function TestKeyRepeatShiftRelease

vt/tests/key_test.go:344–362  ·  view source on GitHub ↗

TestKeyRepeatShiftRelease ensures that releasing shift breaks repeat.

(t *testing.T)

Source from the content-addressed store, hash-verified

342
343// TestKeyRepeatShiftRelease ensures that releasing shift breaks repeat.
344func TestKeyRepeatShiftRelease(t *testing.T) {
345 term := vt.NewMockTerm()
346 defer MustClose(t, term)
347
348 MustStart(t, term)
349
350 // Use a large repeat interval so the test is not sitting on a timing boundary.
351 // We only need to prove that releasing shift changes the repeated value.
352 term.SetRepeat(time.Millisecond*50, time.Millisecond*250)
353
354 term.KeyPress(vt.KeyLShift)
355 term.KeyPress(vt.Key2)
356 term.KeyRelease(vt.KeyLShift)
357 time.Sleep(90 * time.Millisecond)
358 term.KeyPress(vt.Key2)
359 term.KeyRelease(vt.Key2)
360
361 CheckRead(t, term, "@2") // 0 ms, 50 ms
362}
363
364func TestKeyRepeatCursor(t *testing.T) {
365 term := vt.NewMockTerm()

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…