Crate proptest_arbitrary [−] [src]
NOTE: This version is still WIP; don't use yet, just reserving at crates.io.
Proptest is a property testing framework (i.e., the QuickCheck family)
inspired by the Hypothesis framework for
Python.
This crate, proptest-arbitrary, additionally provides an
Arbitrary trait which allows you to have a canonical Strategy
per type. This is the equivalent of Haskell QuickCheck's implementation
of Arbitrary. In this interpretation of Arbitrary, Strategy is the
equivalent of the Gen monad.
Arbitrary is currently implemented as:
/// Arbitrary determines a canonical Strategy [..] pub trait Arbitrary<'a> : Sized + Debug { fn arbitrary() -> Self::Strategy { Self::arbitrary_with(Default::default()) } fn arbitrary_with(args: Self::Parameters) -> Self::Strategy; type Parameters: Default; type Strategy: Strategy<Value = Self::ValueTree>; /// NOTE: /// This type should NOT be relied upon outside of this crate /// other than for implementing `Arbitrary` for other types. type ValueTree: ValueTree<Value = Self>; }
Modules
| bits |
Arbitrary implementations for integral types as bit patterns. |
Structs
| ArrayParamMod |
A function taking |
| CharParameters |
Parameters to pass to |
| Probability |
A probability in the range |
| SizeBounds |
The minimum and maximum bounds on the size of a collection.
The interval must form a subset of |
| StringParameter |
Wraps the regex that forms the |
Traits
| Arbitrary |
Arbitrary determines a canonical |
Functions
| any |
Generates a |
| any_with |
Generates a |
| arbitrary |
Generates a |
| arbitrary_with |
Generates a |
| box_any |
Generates a |
| box_any_with |
Generates a |
| prob |
Creates a |
| sbox_any |
Generates a |
| sbox_any_with |
Generates a |
| size_bounds |
Creates a |
Type Definitions
| Mapped |
A normal map from a strategy of |
| MappedF |
A map from a strategy of |
| MappedS |
A static map from a strategy of |
| ParamsFor |
|
| ParamsType |
|
| StrategyFor |
|
| StrategyType |
|