...

Source file src/github.com/go-redis/redis/internal/internal_test.go

Documentation: github.com/go-redis/redis/internal

     1  package internal
     2  
     3  import (
     4  	"testing"
     5  	"time"
     6  
     7  	. "github.com/onsi/gomega"
     8  )
     9  
    10  func TestRetryBackoff(t *testing.T) {
    11  	RegisterTestingT(t)
    12  
    13  	for i := -1; i <= 16; i++ {
    14  		backoff := RetryBackoff(i, time.Millisecond, 512*time.Millisecond)
    15  		Expect(backoff >= 0).To(BeTrue())
    16  		Expect(backoff <= 512*time.Millisecond).To(BeTrue())
    17  	}
    18  }
    19  

View as plain text