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
Strategytrait object as produced byStrategy::boxed(). - Check
Strategy Sanity Options - Options passed to
check_strategy_sanity(). - Filter
StrategyandValueTreefilter adaptor.- Filter
Map StrategyandValueTreefilter_map adaptor.- Filter
MapValue Tree ValueTreecorresponding toFilterMap.- Flatten
- Adaptor that flattens a
Strategywhich produces otherStrategys into aStrategythat picks one of those strategies and then picks values from it. - Flatten
Value Tree - The
ValueTreeproduced byFlatten. - Fuse
- Adaptor for
StrategyandValueTreewhich guardssimplify()andcomplicate()to avoid contract violations. - IndFlatten
- Similar to
Flatten, but does not shrink the input strategy. - IndFlatten
Map - Similar to
MapplusFlatten, but does not shrink the input strategy and passes the original input through. - Just
- A
Strategywhich always produces a single value value and never simplifies. - Lazy
Just - A
Strategywhich always produces a single value value and never simplifies. IfTisClone, you should useJustinstead. - Lazy
Value Tree - 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.- Perturb
Value Tree ValueTreeperturbation adaptor.- Recursive
- Return type from
Strategy::prop_recursive(). - SBoxed
Strategy - A boxed
Strategytrait object which is alsoSyncandSend, as produced byStrategy::sboxed(). - Shuffle
Strategyshuffle adaptor.- Shuffle
Value Tree ValueTreeshuffling adaptor.- Tuple
Union - Similar to
Union, but internally uses a tuple to hold the strategies. - Tuple
Union Value Tree ValueTreetype produced byTupleUnion.- Union
- A
Strategywhich picks from one of several delegateStrategys. - Union
Value Tree 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.
- Value
Tree - 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§
- Lazy
Just Fn - 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.