diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-18 08:05:32 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-18 08:05:32 +0300 |
| commit | a80ad2b4691d0df63f68c6977ee18444e7bb752f (patch) | |
| tree | 6edc47fcc3c929856826432cf3df3394a14934e8 /internal/tmuxedit/agentutil_test.go | |
| parent | 4ffb22e7f69f1c9c79b095d4e60bad3d97aac55b (diff) | |
ik0 replace remaining test seams with DI
Diffstat (limited to 'internal/tmuxedit/agentutil_test.go')
| -rw-r--r-- | internal/tmuxedit/agentutil_test.go | 7 |
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) { |
