[][src]Trait bolero_engine::Test

pub trait Test: Sized {
    type Value;
    fn test<T: TestInput<Result<bool, PanicError>>>(
        &mut self,
        input: &mut T
    ) -> Result<bool, PanicError>;
fn generate_value<T: TestInput<Self::Value>>(
        &self,
        input: &mut T
    ) -> Self::Value; fn shrink(
        &mut self,
        input: Vec<u8>,
        seed: Option<u64>,
        driver_mode: Option<DriverMode>
    ) -> Option<TestFailure<Self::Value>> { ... } }

Trait for defining a test case

Associated Types

type Value

The input value for the test case

Loading content...

Required methods

fn test<T: TestInput<Result<bool, PanicError>>>(
    &mut self,
    input: &mut T
) -> Result<bool, PanicError>

Execute one test with the given input

fn generate_value<T: TestInput<Self::Value>>(
    &self,
    input: &mut T
) -> Self::Value

Generate a value for the given input.

Note: this is used for printing the value related to a test failure

Loading content...

Provided methods

fn shrink(
    &mut self,
    input: Vec<u8>,
    seed: Option<u64>,
    driver_mode: Option<DriverMode>
) -> Option<TestFailure<Self::Value>>

Shrink the input to a simpler form

Loading content...

Implementors

impl<F: RefUnwindSafe + FnMut(&G::Output) -> Ret, G: RefUnwindSafe + ValueGenerator, Ret> Test for BorrowedGeneratorTest<F, G, G::Output> where
    Ret: IntoTestResult,
    G::Output: RefUnwindSafe + Debug
[src]

type Value = G::Output

impl<F: RefUnwindSafe + FnMut(&[u8]) -> Ret, Ret> Test for F where
    Ret: IntoTestResult
[src]

type Value = SliceDebug<Vec<u8>>

impl<F: RefUnwindSafe + FnMut(&[u8]) -> Ret, Ret> Test for BorrowedSliceTest<F> where
    Ret: IntoTestResult
[src]

type Value = SliceDebug<Vec<u8>>

impl<F: RefUnwindSafe + FnMut(Vec<u8>) -> Ret, Ret> Test for ClonedSliceTest<F> where
    Ret: IntoTestResult
[src]

type Value = SliceDebug<Vec<u8>>

impl<F: RefUnwindSafe + FnMut(G::Output) -> Ret, G: RefUnwindSafe + ValueGenerator, Ret> Test for ClonedGeneratorTest<F, G, G::Output> where
    Ret: IntoTestResult,
    G::Output: RefUnwindSafe + Debug + Clone
[src]

type Value = G::Output

Loading content...