QuickCheck

Derive Macro QuickCheck 

Source
#[derive(QuickCheck)]
{
    // Attributes available to this derive:
    #[quickcheck]
}
Expand description

Generates an implementation of quickcheck::Arbitrary.

You can annotate an enum variant with #[quickcheck(recursive = None | Linear | Exponential)] to allow for testing of potentially infinitely large types

#[derive(Clone, QuickCheck, Debug)]
enum Tree<T> {
    #[quickcheck(recursive = Exponential)]
    Branch(Vec<Tree<T>>),
    Leaf(T),
}

Use exponential for types that exponentially grow with depth (like trees).

Use linear for types that linearly grow with depth (like linked lists).