(t *testing.T)
| 89 | } |
| 90 | |
| 91 | func TestConsumer_Errors(t *testing.T) { |
| 92 | c := newTestConsumer() |
| 93 | go func() { |
| 94 | select { |
| 95 | case c.errs <- errors.New("Hello error"): |
| 96 | case <-time.After(1 * time.Millisecond): |
| 97 | t.Error("timeout") |
| 98 | } |
| 99 | }() |
| 100 | |
| 101 | select { |
| 102 | case err := <-c.Errors(): |
| 103 | if err.Error() != "Hello error" { |
| 104 | t.Error("Error message should match") |
| 105 | } |
| 106 | case <-time.After(1 * time.Millisecond): |
| 107 | t.Error("Errors() channel should deliver errors") |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | func TestConsumer_reportErr(t *testing.T) { |
| 112 | var ( |
nothing calls this directly
no test coverage detected