Files
chain33-dtalk/pkg/time/duration_test.go
2022-03-17 15:59:24 +08:00

21 lines
280 B
Go

package time
import (
"testing"
"time"
)
func TestDurationText(t *testing.T) {
var (
input = []byte("10s")
output = time.Second * 10
d Duration
)
if err := d.UnmarshalText(input); err != nil {
t.FailNow()
}
if int64(output) != int64(d) {
t.FailNow()
}
}