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/service_json_test.go | 37 ----------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 internal/service/service_json_test.go (limited to 'internal/service/service_json_test.go') diff --git a/internal/service/service_json_test.go b/internal/service/service_json_test.go deleted file mode 100644 index c8e073a..0000000 --- a/internal/service/service_json_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package service - -import ( - "encoding/json" - "testing" - - "git.server.ky/slackcoder/mirror/internal" - "github.com/stretchr/testify/require" -) - -func mustJSON(arg interface{}) string { - buf, err := json.Marshal(arg) - if err != nil { - panic(err) - } - - return string(buf) -} - -func TestMirrorUnmarshalJSON(t *testing.T) { - str := mustJSON(map[string]interface{}{ - "method": "git", - "from": "https://git.taler.net/merchant.git", - "to": "/mirror/merchant", - }) - - exp := Mirror{ - Method: "git", - From: internal.MustURL("https://git.taler.net/merchant.git"), - To: internal.MustURL("/mirror/merchant"), - } - - var s Mirror - err := json.Unmarshal([]byte(str), &s) - require.NoError(t, err) - require.Equal(t, exp.String(), s.String()) -} -- cgit v1.2.3