Expand description
Defines the core traits used by Proptest.
Modules§
- statics
- Modified versions of the normal strategy combinators which take specialised traits instead of normal functions.
Structs§
- Boxed
Strategy - A boxed
Strategy
trait object as produced byStrategy::boxed()
. - Check
Strategy Sanity Options - Options passed to
check_strategy_sanity()
. - Filter
Strategy
andValueTree
filter adaptor.- Filter
Map Strategy
andValueTree
filter_map adaptor.- Filter
MapValue Tree ValueTree
corresponding toFilterMap
.- Flatten
- Adaptor that flattens a
Strategy
which produces otherStrategy
s into aStrategy
that picks one of those strategies and then picks values from it. - Flatten
Value Tree - The
ValueTree
produced byFlatten
. - Fuse
- Adaptor for
Strategy
andValueTree
which guardssimplify()
andcomplicate()
to avoid contract violations. - IndFlatten
- Similar to
Flatten
, but does not shrink the input strategy. - IndFlatten
Map - Similar to
Map
plusFlatten
, but does not shrink the input strategy and passes the original input through. - Just
- A
Strategy
which always produces a single value value and never simplifies. - Lazy
Just - A
Strategy
which always produces a single value value and never simplifies. IfT
isClone
, you should useJust
instead. - Lazy
Value Tree - Represents a value tree that is initialized on the first call to any methods.
- Map
Strategy
andValueTree
map adaptor.- MapInto
Strategy
andValueTree
map into adaptor.- NoShrink
- Wraps a
Strategy
orValueTree
to suppress shrinking of generated values. - Perturb
Strategy
perturbation adaptor.- Perturb
Value Tree ValueTree
perturbation adaptor.- Recursive
- Return type from
Strategy::prop_recursive()
. - SBoxed
Strategy - A boxed
Strategy
trait object which is alsoSync
andSend
, as produced byStrategy::sboxed()
. - Shuffle
Strategy
shuffle adaptor.- Shuffle
Value Tree ValueTree
shuffling adaptor.- Tuple
Union - Similar to
Union
, but internally uses a tuple to hold the strategies. - Tuple
Union Value Tree ValueTree
type produced byTupleUnion
.- Union
- A
Strategy
which picks from one of several delegateStrategy
s. - Union
Value Tree ValueTree
corresponding toUnion
.
Traits§
- Shuffleable
- A value which can be used with the
prop_shuffle
combinator. - Strategy
- A strategy for producing arbitrary values of a given type.
- Value
Tree - A generated value and its associated shrinker.
Functions§
- check_
strategy_ sanity - Run some tests on the given
Strategy
to ensure that it upholds the simplify/complicate contracts. - float_
to_ weight - Convert a floating-point weight in the range (0.0,1.0) to a pair of weights
that can be used with
Union
and similar.
Type Aliases§
- Lazy
Just Fn - Shorthand for
LazyJust<T, fn () -> T>
. - NewTree
- A new
ValueTree
from aStrategy
whenOk
or otherwiseErr
when a new value-tree can not be produced for some reason such as in the case of filtering with a predicate which always returns false. You should pass in your strategy as the type parameter. - W
- A relative
weight
of a particularStrategy
corresponding toT
coupled withT
itself. The weight is currently given inu32
. - WA
- A relative
weight
of a particularStrategy
corresponding toT
coupled withArc<T>
. The weight is currently given inu32
.