diff --git a/fuzz.go b/fuzz.go index da0a5f9..3c1ba51 100644 --- a/fuzz.go +++ b/fuzz.go @@ -450,10 +450,10 @@ var fillFuncMap = map[reflect.Kind]func(reflect.Value, *rand.Rand){ v.SetFloat(r.Float64()) }, reflect.Complex64: func(v reflect.Value, r *rand.Rand) { - panic("unimplemented") + v.SetComplex(complex128(complex(r.Float32(), r.Float32()))) }, reflect.Complex128: func(v reflect.Value, r *rand.Rand) { - panic("unimplemented") + v.SetComplex(complex(r.Float64(), r.Float64())) }, reflect.String: func(v reflect.Value, r *rand.Rand) { v.SetString(randString(r)) diff --git a/fuzz_test.go b/fuzz_test.go index 86ad2fa..b98ba63 100644 --- a/fuzz_test.go +++ b/fuzz_test.go @@ -39,6 +39,8 @@ func TestFuzz_basic(t *testing.T) { S string B bool T time.Time + C64 complex64 + C128 complex128 }{} failed := map[string]int{} @@ -87,6 +89,12 @@ func TestFuzz_basic(t *testing.T) { if n, v := "t", obj.T; v.IsZero() { failed[n] = failed[n] + 1 } + if n, v := "c64", obj.C64; v == 0 { + failed[n] = failed[n] + 1 + } + if n, v := "c128", obj.C128; v == 0 { + failed[n] = failed[n] + 1 + } } checkFailed(t, failed) }