cmdRecorder captures the command stream a client sends so tests can assert the presence or absence of individual commands. UNWATCH from Tx.Close flows through ProcessHook; the MULTI/EXEC block flows through ProcessPipelineHook.
| 17 | // the presence or absence of individual commands. UNWATCH from Tx.Close flows |
| 18 | // through ProcessHook; the MULTI/EXEC block flows through ProcessPipelineHook. |
| 19 | type cmdRecorder struct { |
| 20 | mu sync.Mutex |
| 21 | sent []string |
| 22 | } |
| 23 | |
| 24 | func (h *cmdRecorder) record(names ...string) { |
| 25 | h.mu.Lock() |
nothing calls this directly
no outgoing calls
no test coverage detected