Test both nil and empty slices in fuzzer tests

This commit is contained in:
Dan Winship 2016-12-01 09:23:55 -05:00
parent 43e1f6ae1f
commit b8b8b22a9e

View File

@ -45,7 +45,7 @@ import (
// FuzzerFor can randomly populate api objects that are destined for version.
func FuzzerFor(t *testing.T, version schema.GroupVersion, src rand.Source) *fuzz.Fuzzer {
f := fuzz.New().NilChance(.5).NumElements(1, 1)
f := fuzz.New().NilChance(.5).NumElements(0, 1)
if src != nil {
f.RandSource(src)
}