Skip to content

Commit ed2781b

Browse files
authored
Add test case for plural usage on sub-second fractions
1 parent 1e98823 commit ed2781b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/skaffold/util/time/time_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ func TestHumanize(t *testing.T) {
6363
if err != nil {
6464
t.Errorf("%s", err)
6565
}
66+
duration3, err := time.ParseDuration("1h3m0.5s")
67+
if err != nil {
68+
t.Errorf("%s", err)
69+
}
6670
tests := []struct {
6771
description string
6872
value time.Duration
@@ -78,6 +82,11 @@ func TestHumanize(t *testing.T) {
7882
value: duration2,
7983
expected: "5.234 seconds",
8084
},
85+
{
86+
description: "Case for 1h3m0.5s (plural for fraction of second)",
87+
value: duration3,
88+
expected: "1 hour 3 minutes 0.5 seconds",
89+
},
8190
}
8291
for _, test := range tests {
8392
testutil.Run(t, test.description, func(t *testutil.T) {

0 commit comments

Comments
 (0)