mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-13 18:00:00 +08:00
* chore: reverse the order of stopping services * chore: reverse the order of stopping services * chore: reorg imports, format code * chore: format code, and refactor * feat: change MaxRetries default to 0, disable retry
19 lines
313 B
Go
19 lines
313 B
Go
package backoff
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
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))
|
|
}
|