pub struct ConfAndGen<E>where
E: Clone,{
pub conf: Conf,
pub generator: BoxGen<E>,
pub title: Option<String>,
}Expand description
Configuration for executing monkey tests, including the generator.
Fields§
§conf: ConfThe configuration to use.
generator: BoxGen<E>See Conf::with_generator.
title: Option<String>See ConfAndGen::title.
Implementations§
Source§impl<E> ConfAndGen<E>
impl<E> ConfAndGen<E>
Sourcepub fn test_true(&self, prop: Property<E>) -> MonkeyResult<E>where
E: Debug + UnwindSafe,
pub fn test_true(&self, prop: Property<E>) -> MonkeyResult<E>where
E: Debug + UnwindSafe,
Check that the property returns true for all generated example values.
It returns a MonkeyResult to indicate success or
failure.
Sourcepub fn test_property(&self, prop: Property<E>) -> MonkeyResult<E>
👎Deprecated: Use ConfAndGen.test_true instead
pub fn test_property(&self, prop: Property<E>) -> MonkeyResult<E>
This function is deprecated, due to name change, aligning names of different asserts and tests. Use ConfAndGen::test_true instead.
Sourcepub fn assert_true(&self, prop: Property<E>) -> &ConfAndGen<E>
pub fn assert_true(&self, prop: Property<E>) -> &ConfAndGen<E>
Check that the property holds for all generated example values. It panics on failure.
Sourcepub fn assert_no_panic(&self, prop: fn(E)) -> &ConfAndGen<E>
pub fn assert_no_panic(&self, prop: fn(E)) -> &ConfAndGen<E>
Check that the property do not panic for any generated example values. It panics on failure.
Sourcepub fn assert_eq<D>(
&self,
expected: fn(E) -> D,
actual: fn(E) -> D,
) -> &ConfAndGen<E>
pub fn assert_eq<D>( &self, expected: fn(E) -> D, actual: fn(E) -> D, ) -> &ConfAndGen<E>
Check that the two from example derived values, expected and actual, equals each other.
Sourcepub fn assert_ne<D>(
&self,
expected: fn(E) -> D,
actual: fn(E) -> D,
) -> &ConfAndGen<E>
pub fn assert_ne<D>( &self, expected: fn(E) -> D, actual: fn(E) -> D, ) -> &ConfAndGen<E>
Check that the two from example derived values, expected and actual, do not equals each other.
Sourcepub fn with_shrinker(&self, shrink: BoxShrink<E>) -> ConfAndGen<E>
pub fn with_shrinker(&self, shrink: BoxShrink<E>) -> ConfAndGen<E>
Add/change which shriker to use when a failing example is found.
Sourcepub fn title(&self, title: &str) -> ConfAndGen<E>
pub fn title(&self, title: &str) -> ConfAndGen<E>
Add or change title of all following asserts. The title is used for naming the failed property assert. The title is used on all following properties, until other title is set.
Trait Implementations§
Source§impl<E> Clone for ConfAndGen<E>
impl<E> Clone for ConfAndGen<E>
Source§fn clone(&self) -> ConfAndGen<E>
fn clone(&self) -> ConfAndGen<E>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more