You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
312 B
Go
18 lines
312 B
Go
3 years ago
|
package backoff
|
||
|
|
||
|
import (
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
"testing"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func TestWaitBetween(t *testing.T) {
|
||
|
fn := Interval(time.Second)
|
||
|
assert.EqualValues(t, time.Second, fn(1))
|
||
|
}
|
||
|
|
||
|
func TestExponential(t *testing.T) {
|
||
|
fn := Exponential(time.Second)
|
||
|
assert.EqualValues(t, time.Second, fn(1))
|
||
|
}
|