pub struct NoShrink<A: Arbitrary> { /* private fields */ }Expand description
Wrapper for disabling shrinking for an Arbitrary
This type allows generating values via a given Arbitrary implementation
for a test for which we don’t want to shrink input values.
§Example
use quickcheck::{QuickCheck, NoShrink};
fn prop_sane_shrinker() {
// Yielding the original value will result in endless shrinking
fn shrinker_no_self(value: NoShrink<u16>) -> bool {
use quickcheck::Arbitrary;
!value.inner().shrink().any(|v| v == *value.inner())
}
QuickCheck::new().quickcheck(shrinker_no_self as fn(NoShrink<u16>) -> bool);
}Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for NoShrink<A>where
A: Freeze,
impl<A> RefUnwindSafe for NoShrink<A>where
A: RefUnwindSafe,
impl<A> Send for NoShrink<A>where
A: Send,
impl<A> Sync for NoShrink<A>where
A: Sync,
impl<A> Unpin for NoShrink<A>where
A: Unpin,
impl<A> UnwindSafe for NoShrink<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