Module strategy
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
-
BoxedStrategy
A boxed
Strategytrait object as produced byStrategy::boxed(). -
CheckStrategySanityOptions
Options passed to
check_strategy_sanity(). -
Filter
StrategyandValueTreefilter adaptor. -
FilterMap
StrategyandValueTreefilter_map adaptor. -
FilterMapValueTree
ValueTreecorresponding toFilterMap. -
Flatten
Adaptor that flattens a
Strategywhich produces otherStrategys into aStrategythat picks one of those strategies and then picks values from it. -
FlattenValueTree
The
ValueTreeproduced byFlatten. -
Fuse
Adaptor for
StrategyandValueTreewhich guardssimplify()andcomplicate()to avoid contract violations. -
IndFlatten
Similar to
Flatten, but does not shrink the input strategy. -
IndFlattenMap
Similar to
MapplusFlatten, but does not shrink the input strategy and passes the original input through. -
Just
A
Strategywhich always produces a single value and never simplifies. -
LazyJust
A
Strategywhich always produces a single value and never simplifies. IfTisClone, you should useJustinstead. - LazyValueTree Represents a value tree that is initialized on the first call to any methods.
-
Map
StrategyandValueTreemap adaptor. -
MapInto
StrategyandValueTreemap into adaptor. -
NoShrink
Wraps a
StrategyorValueTreeto suppress shrinking of generated values. -
Perturb
Strategyperturbation adaptor. -
PerturbValueTree
ValueTreeperturbation adaptor. -
Recursive
Return type from
Strategy::prop_recursive(). -
SBoxedStrategy
A boxed
Strategytrait object which is alsoSyncandSend, as produced byStrategy::sboxed(). -
Shuffle
Strategyshuffle adaptor. -
ShuffleValueTree
ValueTreeshuffling adaptor. -
TupleUnion
Similar to
Union, but internally uses a tuple to hold the strategies. -
TupleUnionValueTree
ValueTreetype produced byTupleUnion. -
Union
A
Strategywhich picks from one of several delegateStrategys. -
UnionValueTree
ValueTreecorresponding toUnion.
Traits
-
Shuffleable
A value which can be used with the
prop_shufflecombinator. - Strategy A strategy for producing arbitrary values of a given type.
- ValueTree A generated value and its associated shrinker.
Functions
-
check_strategy_sanity
Run some tests on the given
Strategyto 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
Unionand similar.
Type Aliases
-
LazyJustFn
Shorthand for
LazyJust<T, fn () -> T>. -
NewTree
A new
ValueTreefrom aStrategywhenOkor otherwiseErrwhen 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
weightof a particularStrategycorresponding toTcoupled withTitself. The weight is currently given inu32. -
WA
A relative
weightof a particularStrategycorresponding toTcoupled withArc<T>. The weight is currently given inu32.