[−][src]Struct bolero::TestTarget
Configuration for a test target
Implementations
impl<Engine> TestTarget<ByteSliceGenerator, Engine, BorrowedInput>
[src]
pub fn new(
engine: Engine
) -> TestTarget<ByteSliceGenerator, Engine, BorrowedInput>
[src]
engine: Engine
) -> TestTarget<ByteSliceGenerator, Engine, BorrowedInput>
Create a TestTarget
with the given Engine
impl<G, Engine, InputOwnership> TestTarget<G, Engine, InputOwnership>
[src]
pub fn with_generator<Generator: ValueGenerator>(
self,
generator: Generator
) -> TestTarget<Generator, Engine, InputOwnership> where
Generator::Output: Debug,
[src]
self,
generator: Generator
) -> TestTarget<Generator, Engine, InputOwnership> where
Generator::Output: Debug,
Set the value generator for the TestTarget
The function with_generator::<Generator>(generator)
will use the provided Generator
,
which implements generator::ValueGenerator
, to generate input
values of type Generator::Output
.
This mode is used for testing an implementation that requires structured input with specific constraints applied to the type.
pub fn with_type<T: Debug + TypeGenerator>(
self
) -> TestTarget<TypeValueGenerator<T>, Engine, InputOwnership>
[src]
self
) -> TestTarget<TypeValueGenerator<T>, Engine, InputOwnership>
Set the type generator for the TestTarget
Calling with_type::<Type>()
will generate random values of Type
to be tested. Type
is required to implement generator::TypeGenerator
in order to use this method.
This mode is used for testing an implementation that requires structured input.
impl<G: ValueGenerator, Engine, InputOwnership> TestTarget<G, Engine, InputOwnership>
[src]
pub fn map<F: Fn(G::Output) -> T, T: Debug>(
self,
map: F
) -> TestTarget<MapGenerator<G, F>, Engine, InputOwnership>
[src]
self,
map: F
) -> TestTarget<MapGenerator<G, F>, Engine, InputOwnership>
Map the value of the generator
pub fn and_then<F: Fn(G::Output) -> T, T: ValueGenerator>(
self,
map: F
) -> TestTarget<AndThenGenerator<G, F>, Engine, InputOwnership> where
T::Output: Debug,
[src]
self,
map: F
) -> TestTarget<AndThenGenerator<G, F>, Engine, InputOwnership> where
T::Output: Debug,
Map the value of the generator with a new generator
pub fn filter<F: Fn(&G::Output) -> bool>(
self,
filter: F
) -> TestTarget<FilterGenerator<G, F>, Engine, InputOwnership>
[src]
self,
filter: F
) -> TestTarget<FilterGenerator<G, F>, Engine, InputOwnership>
Filter the value of the generator
pub fn filter_map<F: Fn(G::Output) -> Option<T>, T>(
self,
filter_map: F
) -> TestTarget<FilterMapGenerator<G, F>, Engine, InputOwnership>
[src]
self,
filter_map: F
) -> TestTarget<FilterMapGenerator<G, F>, Engine, InputOwnership>
Filter the value of the generator and map it to something else
pub fn with_driver_mode(self, mode: DriverMode) -> Self
[src]
Set the driver mode for the fuzz target
impl<G, InputOwnership> TestTarget<G, RngEngine, InputOwnership>
[src]
pub fn with_iterations(self, iterations: usize) -> Self
[src]
Set the number of iterations executed
pub fn with_max_len(self, max_len: usize) -> Self
[src]
Set the maximum length of the generated bytes
impl<G, Engine> TestTarget<G, Engine, BorrowedInput>
[src]
pub fn cloned(self) -> TestTarget<G, Engine, ClonedInput>
[src]
Use a cloned value for the test input
Cloning the test inputs will force a call to Clone::clone
on each input value, and therefore, will be less
efficient than using a reference.
impl<G, E> TestTarget<G, E, BorrowedInput> where
G: ValueGenerator,
[src]
G: ValueGenerator,
pub fn for_each<F>(self, test: F) -> E::Output where
E: Engine<BorrowedGeneratorTest<F, G, G::Output>>,
BorrowedGeneratorTest<F, G, G::Output>: Test,
[src]
E: Engine<BorrowedGeneratorTest<F, G, G::Output>>,
BorrowedGeneratorTest<F, G, G::Output>: Test,
Iterate over all of the inputs and check the TestTarget
impl<G, E> TestTarget<G, E, ClonedInput> where
G: ValueGenerator,
[src]
G: ValueGenerator,
pub fn for_each<F>(self, test: F) -> E::Output where
E: Engine<ClonedGeneratorTest<F, G, G::Output>>,
ClonedGeneratorTest<F, G, G::Output>: Test,
[src]
E: Engine<ClonedGeneratorTest<F, G, G::Output>>,
ClonedGeneratorTest<F, G, G::Output>: Test,
Iterate over all of the inputs and check the TestTarget
impl<E> TestTarget<ByteSliceGenerator, E, BorrowedInput>
[src]
pub fn for_each<T>(self, test: T) -> E::Output where
E: Engine<BorrowedSliceTest<T>>,
BorrowedSliceTest<T>: Test,
[src]
E: Engine<BorrowedSliceTest<T>>,
BorrowedSliceTest<T>: Test,
Iterate over all of the inputs and check the TestTarget
impl<E> TestTarget<ByteSliceGenerator, E, ClonedInput>
[src]
pub fn for_each<T>(self, test: T) -> E::Output where
E: Engine<ClonedSliceTest<T>>,
ClonedSliceTest<T>: Test,
[src]
E: Engine<ClonedSliceTest<T>>,
ClonedSliceTest<T>: Test,
Iterate over all of the inputs and check the TestTarget
Auto Trait Implementations
impl<Generator, Engine, InputOwnership> RefUnwindSafe for TestTarget<Generator, Engine, InputOwnership> where
Engine: RefUnwindSafe,
Generator: RefUnwindSafe,
InputOwnership: RefUnwindSafe,
Engine: RefUnwindSafe,
Generator: RefUnwindSafe,
InputOwnership: RefUnwindSafe,
impl<Generator, Engine, InputOwnership> Send for TestTarget<Generator, Engine, InputOwnership> where
Engine: Send,
Generator: Send,
InputOwnership: Send,
Engine: Send,
Generator: Send,
InputOwnership: Send,
impl<Generator, Engine, InputOwnership> Sync for TestTarget<Generator, Engine, InputOwnership> where
Engine: Sync,
Generator: Sync,
InputOwnership: Sync,
Engine: Sync,
Generator: Sync,
InputOwnership: Sync,
impl<Generator, Engine, InputOwnership> Unpin for TestTarget<Generator, Engine, InputOwnership> where
Engine: Unpin,
Generator: Unpin,
InputOwnership: Unpin,
Engine: Unpin,
Generator: Unpin,
InputOwnership: Unpin,
impl<Generator, Engine, InputOwnership> UnwindSafe for TestTarget<Generator, Engine, InputOwnership> where
Engine: UnwindSafe,
Generator: UnwindSafe,
InputOwnership: UnwindSafe,
Engine: UnwindSafe,
Generator: UnwindSafe,
InputOwnership: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,