verifyFetchingEvent verifies that one single event arrive on a fetching channel.
(t *testing.T, fetching chan []common.Hash, arrive bool)
| 189 | |
| 190 | // verifyFetchingEvent verifies that one single event arrive on a fetching channel. |
| 191 | func verifyFetchingEvent(t *testing.T, fetching chan []common.Hash, arrive bool) { |
| 192 | if arrive { |
| 193 | select { |
| 194 | case <-fetching: |
| 195 | case <-time.After(time.Second): |
| 196 | t.Fatalf("fetching timeout") |
| 197 | } |
| 198 | } else { |
| 199 | select { |
| 200 | case <-fetching: |
| 201 | t.Fatalf("fetching invoked") |
| 202 | case <-time.After(10 * time.Millisecond): |
| 203 | } |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | // verifyCompletingEvent verifies that one single event arrive on an completing channel. |
| 208 | func verifyCompletingEvent(t *testing.T, completing chan []common.Hash, arrive bool) { |
no outgoing calls
no test coverage detected