internal_test.go 332 字节
Newer Older
Y
Your Name 已提交
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())
	}
}