mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-11-03 15:25:19 +00:00
Replace apimachinery diff.StringDiff with cmp
I forced failures of most of these tests and verified readability
This commit is contained in:
@@ -23,13 +23,12 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/gofuzz"
|
||||
fuzz "github.com/google/gofuzz"
|
||||
|
||||
"k8s.io/apimachinery/pkg/api/apitesting/fuzzer"
|
||||
"k8s.io/apimachinery/pkg/api/apitesting/roundtrip"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/diff"
|
||||
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
||||
)
|
||||
|
||||
@@ -71,7 +70,7 @@ func doDeepCopyTest(t *testing.T, kind schema.GroupVersionKind, f *fuzz.Fuzzer)
|
||||
}
|
||||
|
||||
if !bytes.Equal(prefuzzData.Bytes(), postfuzzData.Bytes()) {
|
||||
t.Log(diff.StringDiff(prefuzzData.String(), postfuzzData.String()))
|
||||
t.Log(cmp.Diff(prefuzzData.String(), postfuzzData.String()))
|
||||
t.Errorf("Fuzzing copy modified original of %#v", kind)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user