reg/vendor/github.com/docker/docker-ce/components/engine/api/types/time/duration_convert_test.go
Jess Frazelle 8e5eba8735
switch to dep
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2017-12-11 14:50:55 -05:00

26 lines
470 B
Go

package time
import (
"testing"
"time"
)
func TestDurationToSecondsString(t *testing.T) {
cases := []struct {
in time.Duration
expected string
}{
{0 * time.Second, "0"},
{1 * time.Second, "1"},
{1 * time.Minute, "60"},
{24 * time.Hour, "86400"},
}
for _, c := range cases {
s := DurationToSecondsString(c.in)
if s != c.expected {
t.Errorf("wrong value for input `%v`: expected `%s`, got `%s`", c.in, c.expected, s)
t.Fail()
}
}
}