flyingmutant / rapid

Rapid is a modern Go property-based testing library
https://pkg.go.dev/pgregory.net/rapid
Mozilla Public License 2.0
588 stars 25 forks source link

`Make[T]()`: add support for field and type overrides #72

Open chrisseto opened 2 months ago

chrisseto commented 2 months ago

👋 I was utilizing rapid for a test involving Kubernetes objects (corev1.Pod) and wanted to leverage Make instead of hand writing all the generation. I was transitioning the tests away from go-fuzz which provides the abilities to skip various fields and override "fuzzing" of others. This PR extends rapid to support a similar feature set.

I'm already using this change in my fork and it works quite well. I'm not overjoyed with the API though but it does get the job done. If you have any suggestions, I'm all ears.

flyingmutant commented 2 months ago

Can you please separate this PR in two parts, support for private fields and type/field customization? Also, please make sure the CI tests all pass.