MCPcopy
hub / github.com/segmentio/kafka-go / testReaderReadCanceled

Function testReaderReadCanceled

reader_test.go:94–101  ·  view source on GitHub ↗
(t *testing.T, ctx context.Context, r *Reader)

Source from the content-addressed store, hash-verified

92}
93
94func testReaderReadCanceled(t *testing.T, ctx context.Context, r *Reader) {
95 ctx, cancel := context.WithCancel(ctx)
96 cancel()
97
98 if _, err := r.ReadMessage(ctx); !errors.Is(err, context.Canceled) {
99 t.Error(err)
100 }
101}
102
103func testReaderReadMessages(t *testing.T, ctx context.Context, r *Reader) {
104 const N = 1000

Callers

nothing calls this directly

Calls 2

ReadMessageMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected