MCPcopy Create free account
hub / github.com/diillson/chatcli / TestInputGuard_Guard_HappyPath

Function TestInputGuard_Guard_HappyPath

cli/coder/input_guard_test.go:108–115  ·  view source on GitHub ↗

TestInputGuard_Guard_HappyPath chains the full sequence: flush TTY + drain channel. Returns true when something was discarded.

(t *testing.T)

Source from the content-addressed store, hash-verified

106// TestInputGuard_Guard_HappyPath chains the full sequence: flush TTY +
107// drain channel. Returns true when something was discarded.
108func TestInputGuard_Guard_HappyPath(t *testing.T) {
109 ch := make(chan string, 2)
110 ch <- "preloaded"
111 g := NewInputGuard(zap.NewNop())
112
113 assert.True(t, g.Guard(ch))
114 assert.Equal(t, 0, len(ch))
115}
116
117// TestInputGuard_Guard_ReportsCleanWhenEmpty ensures the caller can rely on
118// the returned bool to know whether typeahead was suppressed (useful for

Callers

nothing calls this directly

Calls 3

GuardMethod · 0.95
NewInputGuardFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected