first commit
This commit is contained in:
20
pkg/time/duration_test.go
Normal file
20
pkg/time/duration_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user