Test that removing one channel results in no more messages being written to that channel.
(t *testing.T)
| 63 | // Test that removing one channel results in no more messages being |
| 64 | // written to that channel. |
| 65 | func TestSequentialHandler_RemoveOneChannelOfOne(t *testing.T) { |
| 66 | t.Parallel() |
| 67 | handler := NewSequentialSignalHandler() |
| 68 | |
| 69 | channelOne := make(chan *Signal) |
| 70 | handler.(SignalRegistrar).AddSignal(channelOne) |
| 71 | |
| 72 | writeSignals(handler, 1000) |
| 73 | |
| 74 | handler.(SignalRegistrar).RemoveSignal(channelOne) |
| 75 | |
| 76 | count, closed := countSignals(channelOne) |
| 77 | if count > 1 { |
| 78 | t.Error("handler continued writing to channel after removal") |
| 79 | } |
| 80 | if closed { |
| 81 | t.Error("handler closed channel on .RemoveChannel()") |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | // Test that removing one channel results in no more messages being |
| 86 | // written to that channel, and the other channels are unaffected. |
nothing calls this directly
no test coverage detected
searching dependent graphs…