Skip to content

Commit

Permalink
duration_parser_test: remove duplicate test
Browse files Browse the repository at this point in the history
Also consistently use <value>*time.<unit> in duration values.
  • Loading branch information
frobware committed May 24, 2023
1 parent d8fbdeb commit 298a36d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions duration_parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestParseDuration(t *testing.T) {
}, {
description: "valid test with spaces",
input: "1d 3h 30m 45s 100ms 200us",
duration: time.Hour*27 + time.Minute*30 + time.Second*45 + time.Millisecond*100 + time.Microsecond*200,
duration: 27*time.Hour + 30*time.Minute + 45*time.Second + 100*time.Millisecond + 200*time.Microsecond,
}, {
description: "valid test with no space",
input: "1d3h30m45s100ms200us",
Expand All @@ -57,10 +57,6 @@ func TestParseDuration(t *testing.T) {
description: "test with no unit (assume milliseconds)",
input: "5000",
duration: 5000 * time.Millisecond,
}, {
description: "test with no unit (assume milliseconds), and repeated milliseconds",
input: "5000 100ms",
error: "invalid unit order",
}, {
description: "test with no unit (assume milliseconds), followed by another millisecond value",
input: "5000 100ms",
Expand Down

0 comments on commit 298a36d

Please sign in to comment.