[][src]Trait bolero::Test

pub trait Test {
    type Value;
    fn test<T>(&mut self, input: &mut T) -> Result<bool, PanicError>
    where
        T: TestInput<Result<bool, PanicError>>
;
fn generate_value<T>(&self, input: &mut T) -> Self::Value
    where
        T: TestInput<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>(&mut self, input: &mut T) -> Result<bool, PanicError> where
    T: TestInput<Result<bool, PanicError>>, 

Execute one test with the given input

fn generate_value<T>(&self, input: &mut T) -> Self::Value where
    T: TestInput<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...

Implementations on Foreign Types

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

type Value = SliceDebug<Vec<u8>>

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

type Value = <G as ValueGenerator>::Output

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

type Value = <G as ValueGenerator>::Output

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

type Value = SliceDebug<Vec<u8>>

Loading content...

Implementors

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

type Value = SliceDebug<Vec<u8>>

Loading content...