From 298a36df5e8ba657cf15a9a60310fc45e02407c5 Mon Sep 17 00:00:00 2001 From: Andrew McDermott Date: Wed, 24 May 2023 11:22:48 +0100 Subject: [PATCH] duration_parser_test: remove duplicate test Also consistently use *time. in duration values. --- duration_parser_test.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/duration_parser_test.go b/duration_parser_test.go index 1056106..361e434 100644 --- a/duration_parser_test.go +++ b/duration_parser_test.go @@ -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", @@ -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",