summaryrefslogtreecommitdiff
path: root/workhorse/internal/gitaly/unmarshal_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'workhorse/internal/gitaly/unmarshal_test.go')
-rw-r--r--workhorse/internal/gitaly/unmarshal_test.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/workhorse/internal/gitaly/unmarshal_test.go b/workhorse/internal/gitaly/unmarshal_test.go
index 270b96f900d..730eff4005a 100644
--- a/workhorse/internal/gitaly/unmarshal_test.go
+++ b/workhorse/internal/gitaly/unmarshal_test.go
@@ -3,6 +3,7 @@ package gitaly
import (
"testing"
+ "github.com/golang/protobuf/proto" //lint:ignore SA1019 https://gitlab.com/gitlab-org/gitlab/-/issues/324868
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb"
)
@@ -11,25 +12,25 @@ func TestUnmarshalJSON(t *testing.T) {
testCases := []struct {
desc string
in string
- out gitalypb.Repository
+ out *gitalypb.Repository
}{
{
desc: "basic example",
in: `{"relative_path":"foo/bar.git"}`,
- out: gitalypb.Repository{RelativePath: "foo/bar.git"},
+ out: &gitalypb.Repository{RelativePath: "foo/bar.git"},
},
{
desc: "unknown field",
in: `{"relative_path":"foo/bar.git","unknown_field":12345}`,
- out: gitalypb.Repository{RelativePath: "foo/bar.git"},
+ out: &gitalypb.Repository{RelativePath: "foo/bar.git"},
},
}
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
- result := gitalypb.Repository{}
- require.NoError(t, UnmarshalJSON(tc.in, &result))
- require.Equal(t, tc.out, result)
+ result := &gitalypb.Repository{}
+ require.NoError(t, UnmarshalJSON(tc.in, result))
+ require.True(t, proto.Equal(tc.out, result))
})
}
}