mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-14 18:30:02 +08:00
18 lines
312 B
Go
18 lines
312 B
Go
|
|
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))
|
||
|
|
}
|