summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-redis/redis/internal/internal_test.go
blob: 56ff611e10ed0ac8135745b04782bf5cd1aeced9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package internal

import (
	"testing"
	"time"

	. "github.com/onsi/gomega"
)

func TestRetryBackoff(t *testing.T) {
	RegisterTestingT(t)

	for i := -1; i <= 16; i++ {
		backoff := RetryBackoff(i, time.Millisecond, 512*time.Millisecond)
		Expect(backoff >= 0).To(BeTrue())
		Expect(backoff <= 512*time.Millisecond).To(BeTrue())
	}
}