MCPcopy Create free account
hub / github.com/assembla/cony / TestConsumer_Errors

Function TestConsumer_Errors

consumer_test.go:91–109  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

89}
90
91func 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
111func TestConsumer_reportErr(t *testing.T) {
112 var (

Callers

nothing calls this directly

Calls 2

newTestConsumerFunction · 0.85
ErrorsMethod · 0.45

Tested by

no test coverage detected