Struct proptest_quickcheck_interop::QCStrategy
[−]
[src]
pub struct QCStrategy<A: Arbitrary + Debug> { /* fields omitted */ }
QCStrategy
is a Strategy
that provides interoperability with
quickcheck
's Arbitrary
trait. If you have any type implementing
Arbitrary
and Debug
, which a temporary requirement, then you may
get back the equivalent Strategy in proptest.
Methods
impl<A: Arbitrary + Debug> QCStrategy<A>
[src]
fn new(size: usize) -> Self
[src]
Constructs a new QCStrategy
given a size
parameter that:
controls the size of random values generated. For example, it specifies the maximum length of a randomly generated vector and also will specify the maximum magnitude of a randomly generated number.
as defined by quickcheck
Trait Implementations
impl<A: Copy + Arbitrary + Debug> Copy for QCStrategy<A>
[src]
impl<A: Clone + Arbitrary + Debug> Clone for QCStrategy<A>
[src]
fn clone(&self) -> QCStrategy<A>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<A: PartialEq + Arbitrary + Debug> PartialEq for QCStrategy<A>
[src]
fn eq(&self, __arg_0: &QCStrategy<A>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &QCStrategy<A>) -> bool
[src]
This method tests for !=
.
impl<A: Eq + Arbitrary + Debug> Eq for QCStrategy<A>
[src]
impl<A: PartialOrd + Arbitrary + Debug> PartialOrd for QCStrategy<A>
[src]
fn partial_cmp(&self, __arg_0: &QCStrategy<A>) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &QCStrategy<A>) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &QCStrategy<A>) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &QCStrategy<A>) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &QCStrategy<A>) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<A: Ord + Arbitrary + Debug> Ord for QCStrategy<A>
[src]
fn cmp(&self, __arg_0: &QCStrategy<A>) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl<A: Hash + Arbitrary + Debug> Hash for QCStrategy<A>
[src]
fn hash<__HA: Hasher>(&self, __arg_0: &mut __HA)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<A: Debug + Arbitrary + Debug> Debug for QCStrategy<A>
[src]
impl<A: Arbitrary + Debug> Strategy for QCStrategy<A>
[src]
type Value = QCValueTree<A>
The value tree generated by this Strategy
. Read more
fn new_value(&self, runner: &mut TestRunner) -> NewTree<Self>
[src]
Generate a new value tree from the given runner. Read more
fn prop_map<O, F>(self, fun: F) -> Map<Self, F> where
F: Fn(<Self::Value as ValueTree>::Value) -> O,
O: Debug,
[src]
F: Fn(<Self::Value as ValueTree>::Value) -> O,
O: Debug,
Returns a strategy which produces values transformed by the function fun
. Read more
fn prop_perturb<O, F>(self, fun: F) -> Perturb<Self, F> where
F: Fn(<Self::Value as ValueTree>::Value, XorShiftRng) -> O,
O: Debug,
[src]
F: Fn(<Self::Value as ValueTree>::Value, XorShiftRng) -> O,
O: Debug,
Returns a strategy which produces values transformed by the function fun
, which is additionally given a random number generator. Read more
fn prop_flat_map<S, F>(self, fun: F) -> Flatten<Map<Self, F>> where
F: Fn(<Self::Value as ValueTree>::Value) -> S,
S: Strategy,
[src]
F: Fn(<Self::Value as ValueTree>::Value) -> S,
S: Strategy,
Maps values produced by this strategy into new strategies and picks values from those strategies. Read more
fn prop_ind_flat_map<S, F>(self, fun: F) -> IndFlatten<Map<Self, F>> where
F: Fn(<Self::Value as ValueTree>::Value) -> S,
S: Strategy,
[src]
F: Fn(<Self::Value as ValueTree>::Value) -> S,
S: Strategy,
Maps values produced by this strategy into new strategies and picks values from those strategies while considering the new strategies to be independent. Read more
fn prop_ind_flat_map2<S, F>(self, fun: F) -> IndFlattenMap<Self, F> where
F: Fn(<Self::Value as ValueTree>::Value) -> S,
S: Strategy,
[src]
F: Fn(<Self::Value as ValueTree>::Value) -> S,
S: Strategy,
Similar to prop_ind_flat_map()
, but produces 2-tuples with the input generated from self
in slot 0 and the derived strategy in slot 1. Read more
fn prop_filter<R, F>(self, whence: R, fun: F) -> Filter<Self, F> where
F: Fn(&<Self::Value as ValueTree>::Value) -> bool,
R: Into<Reason>,
[src]
F: Fn(&<Self::Value as ValueTree>::Value) -> bool,
R: Into<Reason>,
Returns a strategy which only produces values accepted by fun
. Read more
fn prop_union(self, other: Self) -> Union<Self>
[src]
Returns a strategy which picks uniformly from self
and other
. Read more
fn prop_recursive<F>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F
) -> Recursive<Box<Strategy<Value = Box<ValueTree<Value = <Self::Value as ValueTree>::Value> + 'static>> + 'static>, F> where
F: Fn(Arc<Box<Strategy<Value = Box<ValueTree<Value = <Self::Value as ValueTree>::Value> + 'static>> + 'static>>) -> Box<Strategy<Value = Box<ValueTree<Value = <Self::Value as ValueTree>::Value> + 'static>> + 'static>,
Self: 'static,
[src]
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F
) -> Recursive<Box<Strategy<Value = Box<ValueTree<Value = <Self::Value as ValueTree>::Value> + 'static>> + 'static>, F> where
F: Fn(Arc<Box<Strategy<Value = Box<ValueTree<Value = <Self::Value as ValueTree>::Value> + 'static>> + 'static>>) -> Box<Strategy<Value = Box<ValueTree<Value = <Self::Value as ValueTree>::Value> + 'static>> + 'static>,
Self: 'static,
Generate a recursive structure with self
items as leaves. Read more
fn prop_shuffle(self) -> Shuffle<Self> where
<Self::Value as ValueTree>::Value: Shuffleable,
[src]
<Self::Value as ValueTree>::Value: Shuffleable,
Shuffle the contents of the values produced by this strategy. Read more
fn boxed(
self
) -> Box<Strategy<Value = Box<ValueTree<Value = <Self::Value as ValueTree>::Value> + 'static>> + 'static> where
Self: 'static,
[src]
self
) -> Box<Strategy<Value = Box<ValueTree<Value = <Self::Value as ValueTree>::Value> + 'static>> + 'static> where
Self: 'static,
Erases the type of this Strategy
so it can be passed around as a simple trait object. Read more
fn sboxed(
self
) -> Box<Strategy<Value = Box<ValueTree<Value = <Self::Value as ValueTree>::Value> + 'static>> + 'static + Sync + Send> where
Self: Send + Sync + 'static,
[src]
self
) -> Box<Strategy<Value = Box<ValueTree<Value = <Self::Value as ValueTree>::Value> + 'static>> + 'static + Sync + Send> where
Self: Send + Sync + 'static,
Erases the type of this Strategy
so it can be passed around as a simple trait object. Read more
fn no_shrink(self) -> NoShrink<Self>
[src]
Wraps this strategy to prevent values from being subject to shrinking. Read more