mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 09:40:24 +08:00
429f85a9de
* feat: slow threshold customizable in redis * chore: improve config robustness
15 lines
299 B
Go
15 lines
299 B
Go
package conf
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestCheckedDuration(t *testing.T) {
|
|
assert.Equal(t, time.Second, CheckedDuration(1000))
|
|
assert.Equal(t, 2*time.Second, CheckedDuration(2000))
|
|
assert.Equal(t, 2*time.Second, CheckedDuration(time.Second*2))
|
|
}
|