Skip to content

Commit 945873c

Browse files
committed
test: utils
1 parent 5d0121c commit 945873c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

utils/utils_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package utils
2+
3+
import "testing"
4+
5+
func TestUtils(t *testing.T) {
6+
t.Run("DurationToSeconds", func(t *testing.T) {
7+
suite := map[string]float64{
8+
"00:00:05.31": 5.310000,
9+
"00:02:14.31": 134.310000,
10+
"00:00:27.25": 27.25,
11+
"invalid": 0,
12+
}
13+
14+
for duration, expected := range suite {
15+
if e := DurationToSeconds(duration); e != expected {
16+
t.Errorf("expected: %f, got: %f", expected, e)
17+
}
18+
}
19+
})
20+
}

0 commit comments

Comments
 (0)