TestInputGuard_Guard_HappyPath chains the full sequence: flush TTY + drain channel. Returns true when something was discarded.
(t *testing.T)
| 106 | // TestInputGuard_Guard_HappyPath chains the full sequence: flush TTY + |
| 107 | // drain channel. Returns true when something was discarded. |
| 108 | func 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 |
nothing calls this directly
no test coverage detected