Closed remexre closed 4 years ago
Struct shrinking is implementing by transforming a struct into a tuple, shrinking the tuple, and mapping it back to the struct. 9-tuples and larger cannot be shrunk (see #146), so structs with more than 8 members cannot either.
This could be fixed by nesting tuples ie, for a three field struct you could generate an arbitrary for (A, (B, C))
What's the state of this pull request? Automated deriving of instances would be really great!
@marcelbuesing It's fallen off my plate more or less completely; if someone else wants to take it across the finish line, that'll probably happen before I have time to come back to it.
Summary:
Implements a stable-friendly
#[derive(Arbitrary)]
, with support for generation, shrinking, and constraints. Example:Known Issues:
this
instead ofself
. Constraints get turned into a function defined inside thearbitrary
method, where noself
exists. They therefore cannot useself
(at least, to my knowledge).