-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
derive macro for Arbitrary is hard to find #463
Comments
Hi, this already exists: https://proptest-rs.github.io/proptest/proptest-derive/index.html https://crates.io/crates/proptest-derive Let us know if this addresses your use case or if there are improvements you'd like to see |
is there a reason for burying this all the way at the end? personally i would have reexported this gated under a |
The two crates are documented separately so first we document the proptest crate and then we document the proptest-derive crate. We can embed some more mention of the derive macro earlier on in the book and in the api docs |
It is mentioned in this area of the book about defining a canonical strategy: I'll add a note in the doc comments of |
probably the biggest hurdle to using proptest is the need to manually implement Arbitrary for a type. the ability to have a derive macro, even if it was really limited (eg. only unit enums) would be incredibly useful.
obviously this derive macro couldn't figure out the best methods for shrinking a value and such, but often it wouldn't need to, as a lot of types (like unit enums) don't have any meaningful way they can be shrunk.
The text was updated successfully, but these errors were encountered: