summaryrefslogtreecommitdiff
path: root/internal/tmuxedit/agentutil_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/tmuxedit/agentutil_test.go')
-rw-r--r--internal/tmuxedit/agentutil_test.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/tmuxedit/agentutil_test.go b/internal/tmuxedit/agentutil_test.go
index eed245c..3cafb3b 100644
--- a/internal/tmuxedit/agentutil_test.go
+++ b/internal/tmuxedit/agentutil_test.go
@@ -199,13 +199,15 @@ func TestParseKeyRepeat(t *testing.T) {
func TestSendClearSequence_EscapeKey(t *testing.T) {
var calls []string
+ var escapeSleeps int
deps := tmuxEditDeps{sendKeys: func(paneID string, keys ...string) error {
calls = append(calls, strings.Join(keys, ","))
return nil
+ }, sleepAfterEscape: func() {
+ escapeSleeps++
}}
// sendClearSequence with "Escape" should succeed and send the key.
- // The 150ms Escape delay is real but acceptable in tests.
err := deps.sendClearSequence("%1", "Escape C-k")
if err != nil {
t.Fatalf("unexpected error: %v", err)
@@ -219,6 +221,9 @@ func TestSendClearSequence_EscapeKey(t *testing.T) {
t.Errorf("call[%d] = %q, want %q", i, calls[i], w)
}
}
+ if escapeSleeps != 1 {
+ t.Fatalf("escape sleeps = %d, want 1", escapeSleeps)
+ }
}
func TestSendClearSequence_SingleKeyError(t *testing.T) {