From d7b3c49d5cf467b90ce6f3399e77caa630f01a49 Mon Sep 17 00:00:00 2001 From: Slack Coder Date: Mon, 5 Aug 2024 04:48:55 -0500 Subject: Set To Do branch --- internal/service/config_test.go | 54 ----------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 internal/service/config_test.go (limited to 'internal/service/config_test.go') diff --git a/internal/service/config_test.go b/internal/service/config_test.go deleted file mode 100644 index c9af1e7..0000000 --- a/internal/service/config_test.go +++ /dev/null @@ -1,54 +0,0 @@ -package service - -import ( - "encoding/json" - "testing" - "time" - - "github.com/stretchr/testify/require" -) - -func TestDurationMarshal(t *testing.T) { - tests := []struct { - arg Duration - exp string - }{ - { - Duration{time.Second}, - "\"1s\"", - }, - { - Duration{time.Minute}, - "\"1m0s\"", - }, - } - - for _, test := range tests { - v, err := json.Marshal(test.arg) - require.NoError(t, err) - require.Equal(t, test.exp, string(v)) - } -} - -func TestDurationUnmarshal(t *testing.T) { - tests := []struct { - arg string - exp Duration - }{ - { - "\"1s\"", - Duration{time.Second}, - }, - { - "\"1m0s\"", - Duration{time.Minute}, - }, - } - - for _, test := range tests { - var v Duration - err := json.Unmarshal([]byte(test.arg), &v) - require.NoError(t, err) - require.Equal(t, test.exp.Duration, v.Duration) - } -} -- cgit v1.2.3