redis/internal/internal_test.go

19 lines
332 B
Go
Raw Permalink Normal View History

2017-05-25 08:08:44 +03:00
package internal
import (
"testing"
"time"
2017-07-09 13:10:07 +03:00
. "github.com/onsi/gomega"
2017-05-25 08:08:44 +03:00
)
func TestRetryBackoff(t *testing.T) {
RegisterTestingT(t)
2017-07-09 13:10:07 +03:00
for i := -1; i <= 16; i++ {
backoff := RetryBackoff(i, time.Millisecond, 512*time.Millisecond)
2017-05-25 08:08:44 +03:00
Expect(backoff >= 0).To(BeTrue())
Expect(backoff <= 512*time.Millisecond).To(BeTrue())
}
}