Skip to content

Commit 09a25f5

Browse files
committed
change assert library with cmp library
1 parent c85e810 commit 09a25f5

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ require (
88
github.com/go-git/go-git/v5 v5.1.0
99
github.com/go-logr/logr v0.3.0
1010
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
11+
github.com/google/go-cmp v0.5.2
1112
github.com/prometheus/client_golang v1.7.1
1213
github.com/stretchr/testify v1.6.1
1314
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0

pkg/patterns/declarative/sort_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ import (
2020
"context"
2121
"testing"
2222

23-
"github.com/stretchr/testify/assert"
23+
"github.com/google/go-cmp/cmp"
24+
"github.com/google/go-cmp/cmp/cmpopts"
25+
2426
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
2527
"sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/declarative/pkg/manifest"
2628
)
@@ -222,7 +224,9 @@ func Test_Sort(t *testing.T) {
222224
t.Run(tc.name, func(t *testing.T) {
223225
ctx := context.Background()
224226
tc.input.Sort(DefaultObjectOrder(ctx))
225-
assert.Equal(t, tc.expected, tc.input)
227+
if diff := cmp.Diff(tc.expected, tc.input, cmpopts.IgnoreUnexported(manifest.Object{})); diff != "" {
228+
t.Errorf("sort result mismatch (-want +got):\n%s", diff)
229+
}
226230
})
227231
}
228232

0 commit comments

Comments
 (0)