redis/internal/internal_test.go

19 lines
330 B
Go
Raw Normal View History

2024-06-20 02:30:37 +03:00
package internal
import (
"testing"
"time"
. "github.com/bsm/gomega"
)
func TestRetryBackoff(t *testing.T) {
RegisterTestingT(t)
for i := 0; i <= 16; i++ {
backoff := RetryBackoff(i, time.Millisecond, 512*time.Millisecond)
Expect(backoff >= 0).To(BeTrue())
Expect(backoff <= 512*time.Millisecond).To(BeTrue())
}
}