pub struct QCStrategy<A: Arbitrary + Debug> { /* private fields */ }Expand description
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.
Implementations§
Source§impl<A: Arbitrary + Debug> QCStrategy<A>
impl<A: Arbitrary + Debug> QCStrategy<A>
Sourcepub fn new(size: usize) -> Self
pub fn new(size: usize) -> Self
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§
Source§impl<A: Clone + Arbitrary + Debug> Clone for QCStrategy<A>
impl<A: Clone + Arbitrary + Debug> Clone for QCStrategy<A>
Source§fn clone(&self) -> QCStrategy<A>
fn clone(&self) -> QCStrategy<A>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<A: Copy + Arbitrary + Debug> Copy for QCStrategy<A>
impl<A: Eq + Arbitrary + Debug> Eq for QCStrategy<A>
Source§impl<A: Ord + Arbitrary + Debug> Ord for QCStrategy<A>
impl<A: Ord + Arbitrary + Debug> Ord for QCStrategy<A>
Source§fn cmp(&self, other: &QCStrategy<A>) -> Ordering
fn cmp(&self, other: &QCStrategy<A>) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<A: PartialEq + Arbitrary + Debug> PartialEq for QCStrategy<A>
impl<A: PartialEq + Arbitrary + Debug> PartialEq for QCStrategy<A>
Source§fn eq(&self, other: &QCStrategy<A>) -> bool
fn eq(&self, other: &QCStrategy<A>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<A: PartialOrd + Arbitrary + Debug> PartialOrd for QCStrategy<A>
impl<A: PartialOrd + Arbitrary + Debug> PartialOrd for QCStrategy<A>
Source§impl<A: Arbitrary + Debug> Strategy for QCStrategy<A>
impl<A: Arbitrary + Debug> Strategy for QCStrategy<A>
Source§type Value = QCValueTree<A>
type Value = QCValueTree<A>
The value tree generated by this
Strategy. Read moreSource§fn new_value(&self, runner: &mut TestRunner) -> NewTree<Self>
fn new_value(&self, runner: &mut TestRunner) -> NewTree<Self>
Generate a new value tree from the given runner. Read more
Source§fn prop_map<O, F>(self, fun: F) -> Map<Self, F>
fn prop_map<O, F>(self, fun: F) -> Map<Self, F>
Returns a strategy which produces values transformed by the function
fun. Read moreSource§fn prop_perturb<O, F>(self, fun: F) -> Perturb<Self, F>
fn prop_perturb<O, F>(self, fun: F) -> Perturb<Self, F>
Returns a strategy which produces values transformed by the function
fun, which is additionally given a random number generator. Read moreSource§fn prop_flat_map<S, F>(self, fun: F) -> Flatten<Map<Self, F>>
fn prop_flat_map<S, F>(self, fun: F) -> Flatten<Map<Self, F>>
Maps values produced by this strategy into new strategies and picks
values from those strategies. Read more
Source§fn prop_ind_flat_map<S, F>(self, fun: F) -> IndFlatten<Map<Self, F>>
fn prop_ind_flat_map<S, F>(self, fun: F) -> IndFlatten<Map<Self, F>>
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
Source§fn prop_ind_flat_map2<S, F>(self, fun: F) -> IndFlattenMap<Self, F>
fn prop_ind_flat_map2<S, F>(self, fun: F) -> IndFlattenMap<Self, F>
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 moreSource§fn prop_filter<R, F>(self, whence: R, fun: F) -> Filter<Self, F>
fn prop_filter<R, F>(self, whence: R, fun: F) -> Filter<Self, F>
Returns a strategy which only produces values accepted by
fun. Read moreSource§fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
Source§fn prop_recursive<F>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Box<dyn Strategy<Value = Box<dyn ValueTree<Value = <Self::Value as ValueTree>::Value>>>>, F>
fn prop_recursive<F>( self, depth: u32, desired_size: u32, expected_branch_size: u32, recurse: F, ) -> Recursive<Box<dyn Strategy<Value = Box<dyn ValueTree<Value = <Self::Value as ValueTree>::Value>>>>, F>
Generate a recursive structure with
self items as leaves. Read moreSource§fn prop_shuffle(self) -> Shuffle<Self>
fn prop_shuffle(self) -> Shuffle<Self>
Shuffle the contents of the values produced by this strategy. Read more
Source§fn boxed(
self,
) -> Box<dyn Strategy<Value = Box<dyn ValueTree<Value = <Self::Value as ValueTree>::Value>>>>where
Self: Sized + 'static,
fn boxed(
self,
) -> Box<dyn Strategy<Value = Box<dyn ValueTree<Value = <Self::Value as ValueTree>::Value>>>>where
Self: Sized + 'static,
Erases the type of this
Strategy so it can be passed around as a
simple trait object. Read moreimpl<A: PartialEq + Arbitrary + Debug> StructuralPartialEq for QCStrategy<A>
Auto Trait Implementations§
impl<A> Freeze for QCStrategy<A>
impl<A> RefUnwindSafe for QCStrategy<A>where
A: RefUnwindSafe,
impl<A> Send for QCStrategy<A>
impl<A> Sync for QCStrategy<A>where
A: Sync,
impl<A> Unpin for QCStrategy<A>where
A: Unpin,
impl<A> UnsafeUnpin for QCStrategy<A>
impl<A> UnwindSafe for QCStrategy<A>where
A: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more