testEmitter is an emitter that can be used in tests. It records all events emitted, and whether it has been closed.
| 26 | // testEmitter is an emitter that can be used in tests. It records all events |
| 27 | // emitted, and whether it has been closed. |
| 28 | type testEmitter struct { |
| 29 | // mu protects all fields below. |
| 30 | mu sync.Mutex |
| 31 | |
| 32 | // events contains all emitted events. |
| 33 | events []proto.Message |
| 34 | |
| 35 | // closed records whether Close() was called. |
| 36 | closed bool |
| 37 | } |
| 38 | |
| 39 | // Emit implements Emitter.Emit. |
| 40 | func (te *testEmitter) Emit(msg proto.Message) (bool, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected