Expand description
Defines the Arbitrary
trait and related free functions
and type aliases.
See the Arbitrary
trait for more information.
Modules§
- functor
- Provides higher order
Arbitrary
traits. This is mainly for use byproptest_derive
.
Traits§
Functions§
- any
- Generates a
Strategy
producingArbitrary
values ofA
. Unlikearbitrary
, it should be used for being explicit on whatA
is. For clarity, this may be a good idea. - any_
with - 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. - arbitrary
- Generates a
Strategy
producingArbitrary
values ofA
. Works better with type inference thanany::<A>()
. - arbitrary_
with - Generates a
Strategy
producingArbitrary
values ofA
with the given configuration arguments passed inargs
. Works better with type inference thanany_with::<A>(args)
.
Type Aliases§
- Mapped
- A normal map from a strategy of
I
toO
. - Params
For 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.- SMapped
- A static map from a strategy of
I
toO
. - Strategy
For 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).