Verifies that after termination, the handler does not process any further signals.
(t *testing.T)
| 151 | |
| 152 | // Verifies that after termination, the handler does not process any further signals. |
| 153 | func TestSequentialHandler_TerminateTerminates(t *testing.T) { |
| 154 | t.Parallel() |
| 155 | handler := NewSequentialSignalHandler() |
| 156 | handler.(Terminator).Terminate() |
| 157 | |
| 158 | channelOne := make(chan *Signal) |
| 159 | handler.(SignalRegistrar).AddSignal(channelOne) |
| 160 | |
| 161 | writeSignals(handler, 10) |
| 162 | |
| 163 | count, _ := countSignals(channelOne) |
| 164 | if count > 0 { |
| 165 | t.Errorf("handler continued operating after termination; read %v signals", count) |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | // Verifies calling .Terminate() more than once is equivalent to calling it just once. |
| 170 | func TestSequentialHandler_TerminateIdemopotent(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…