]> Sergey Matveev's repositories - btrtrc.git/blobdiff - rlreader_test.go
Drop support for go 1.20
[btrtrc.git] / rlreader_test.go
index 529cbee6968940ad4a68b5a2e0eb5f970e73ff26..6bf25c432c6ba3269c9cbbce2ecf81d2681dc323 100644 (file)
@@ -5,14 +5,12 @@ import (
        "log"
        "math/rand"
        "sync"
+       "testing"
        "time"
 
-       "github.com/bradfitz/iter"
        "github.com/stretchr/testify/assert"
        "github.com/stretchr/testify/require"
        "golang.org/x/time/rate"
-
-       "testing"
 )
 
 func writeN(ws []io.Writer, n int) error {
@@ -60,7 +58,7 @@ func TestRateLimitReaders(t *testing.T) {
        }
        reads := make(chan read)
        done := make(chan struct{})
-       for range iter.N(numReaders) {
+       for i := 0; i < numReaders; i += 1 {
                r, w := io.Pipe()
                ws = append(ws, w)
                cs = append(cs, w)
@@ -100,7 +98,7 @@ func TestRateLimitReaders(t *testing.T) {
        }()
        written := 0
        go func() {
-               for range iter.N(writeRounds) {
+               for i := 0; i < writeRounds; i += 1 {
                        err := writeN(ws, bytesPerRound)
                        if err != nil {
                                log.Printf("error writing: %s", err)