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, proptestarbitrary
, 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>; }
Structs
CharParam 
Parameters to pass to 
Generator 
Strategy for generating 
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 
StringParam 
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 
prob 
Creates a 
size_bounds 
Creates a 
Type Definitions
FnGenerator 
Shorthand for 
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 
