Module arbitrary
Expand description
Defines the Arbitrary
trait and related free functions
and type aliases.
See the Arbitrary
trait for more information.
Modules§
- Provides higher order
Arbitrary
traits. This is mainly for use byproptest_derive
.
Traits§
- Arbitrary determines a canonical
Strategy
for the implementing type.
Functions§
- Generates a
Strategy
producingArbitrary
values ofA
with the given configuration arguments passed inargs
. Unlikearbitrary_with
, it should be used for being explicit on whatA
is. For clarity, this may be a good idea. - Generates a
Strategy
producingArbitrary
values ofA
. Works better with type inference thanany::<A>()
. - Generates a
Strategy
producingArbitrary
values ofA
with the given configuration arguments passed inargs
. Works better with type inference thanany_with::<A>(args)
.
Type Aliases§
- A normal map from a strategy of
I
toO
. ParamsFor
allows you to mention the type ofParameters
for the input typeA
without directly using associated types or without resorting to existential types. This way, if implementation ofArbitrary
changes, your tests should not break.- A static map from a strategy of
I
toO
. StrategyFor
allows you to mention the type ofStrategy
for the input typeA
without directly using associated types or without resorting to existential types. This way, if implementation ofArbitrary
changes, your tests should not break. This can be especially beneficial when the type ofStrategy
that you are dealing with is very long in name (the case with generics).