diff --git a/iter_test.go b/iter_test.go index a869446..74991db 100644 --- a/iter_test.go +++ b/iter_test.go @@ -338,6 +338,13 @@ func TestCancelCustomIterCh(t *testing.T) { defer ch.Close() go func(ch IterChCloser) { + i := 0 + for range ch.Records() { + if i == 50 { + ch.Close() + } + i++ + } if err := verifyRecords(ch.Records(), params.Reversed); err != nil { if err.Error() != "Channel was nil." { t.Fatal(err)