[][src]Struct monarch::MetamorphicTestRunner

pub struct MetamorphicTestRunner<IN: Clone + Debug, OUT: UnwindSafe> { /* fields omitted */ }

The struct responsible for running the metamorphic test suite.

Methods

impl<IN: Clone + Debug, OUT: UnwindSafe> MetamorphicTestRunner<IN, OUT>[src]

pub fn new() -> Self[src]

Construct a new test runner.

pub fn add_transformation(&mut self, f: impl Fn(&mut IN) -> IN + 'static)[src]

Supply an additional way of transforming an input.

pub fn set_input(&mut self, input: IN)[src]

Set the initial input.

This initial input along with the operation will be used to compute an output against which all other outputs will be compared using the supplied metamorphic relation.

pub fn set_operation(&mut self, f: impl Fn(&IN) -> OUT + 'static)[src]

Set the operation which will be used to compute an output for each input.

pub fn set_relation(&mut self, f: impl Fn(&OUT, &OUT) -> bool + 'static)[src]

Set the metamorphic relation which determines whether two outputs pass the test.

pub fn run(&mut self) -> Result<(), MonarchError>[src]

Run the metamorphic test.

Trait Implementations

impl<IN: Clone + Debug, OUT: UnwindSafe> Default for MetamorphicTestRunner<IN, OUT>[src]

Auto Trait Implementations

impl<IN, OUT> !Send for MetamorphicTestRunner<IN, OUT>

impl<IN, OUT> !Sync for MetamorphicTestRunner<IN, OUT>

impl<IN, OUT> Unpin for MetamorphicTestRunner<IN, OUT> where
    IN: Unpin

impl<IN, OUT> !UnwindSafe for MetamorphicTestRunner<IN, OUT>

impl<IN, OUT> !RefUnwindSafe for MetamorphicTestRunner<IN, OUT>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]