Skip to content

Commit 0a0e63a

Browse files
committed
Use switch test to gofuzz
randfill isn't available in 4.19
1 parent de99adb commit 0a0e63a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

staging/src/k8s.io/apimachinery/pkg/runtime/serializer/protobuf/collections_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525

2626
"github.com/gogo/protobuf/proto"
2727
"github.com/google/go-cmp/cmp"
28-
"sigs.k8s.io/randfill"
28+
fuzz "github.com/google/gofuzz"
2929

3030
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3131
testapigroupv1 "k8s.io/apimachinery/pkg/apis/testapigroup/v1"
@@ -265,14 +265,14 @@ func (b *writeCountingBuffer) Reset() {
265265
}
266266

267267
func TestFuzzCollection(t *testing.T) {
268-
f := randfill.New()
268+
f := fuzz.New()
269269
streamingEncoder := NewSerializerWithOptions(nil, nil, SerializerOptions{StreamingCollectionsEncoding: true})
270270
streamingBuffer := &bytes.Buffer{}
271271
normalEncoder := NewSerializerWithOptions(nil, nil, SerializerOptions{StreamingCollectionsEncoding: false})
272272
normalBuffer := &bytes.Buffer{}
273273
for i := 0; i < 1000; i++ {
274274
list := &testapigroupv1.CarpList{}
275-
f.FillNoCustom(list)
275+
f.FuzzNoCustom(list)
276276
streamingBuffer.Reset()
277277
normalBuffer.Reset()
278278
if err := streamingEncoder.Encode(list, streamingBuffer); err != nil {

0 commit comments

Comments
 (0)