File: internal_test.go

package info (click to toggle)
golang-github-go-redis-redis 6.14.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 736 kB
  • sloc: makefile: 20
file content (18 lines) | stat: -rw-r--r-- 332 bytes parent folder | download | duplicates (2)
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())
	}
}