Skip to main content

TestRunner

Struct TestRunner 

Source
pub struct TestRunner<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> TestRunner<'a>

Source

pub fn new_fifo_runner() -> Self

Source

pub fn new_file_runner() -> Self

Source

pub fn new_dprintln_runner() -> Self

Source

pub fn run<F: Fn(&mut TestRunner<'_>)>(&mut self, f: F)

Source

pub fn start_run(&self)

Source

pub fn finish_run(self)

Source

pub fn check_fns_do_not_panic(&self, tests: &[(&str, &dyn Fn())])

Source

pub fn check<T>(&mut self, testcase_name: &'a str, l: T, r: T)
where T: Debug + PartialEq,

Source

pub fn check_true(&mut self, testcase_name: &'a str, pred: bool)

Source

pub fn check_large_collection<T>( &mut self, testcase_name: &'a str, l: &[T], r: &[T], )
where T: Debug + PartialEq + Eq,

Source

pub fn check_silent<T>(&mut self, testcase_name: &'a str, l: T, r: T)
where T: Debug + PartialEq,

Source

pub fn check_list<T>(&mut self, val_pairs: &[(&'a str, T, T)])
where T: Debug + PartialEq,

Source

pub fn _check_return_values<T>( &mut self, val_pairs: &[(&'a str, &dyn Fn() -> T, T)], )
where T: Debug + PartialEq + Eq + Clone,

Source

pub fn pass(&self, testcase_name: &str, msg: &str)

Source

pub fn dbg(&self, testcase_name: &str, msg: &str)

Source

pub fn fail(&mut self, testcase_name: &'a str, msg: &str)

Source

pub fn write_args(&self, args: Arguments<'_>)

Auto Trait Implementations§

§

impl<'a> Freeze for TestRunner<'a>

§

impl<'a> RefUnwindSafe for TestRunner<'a>

§

impl<'a> Send for TestRunner<'a>

§

impl<'a> Sync for TestRunner<'a>

§

impl<'a> Unpin for TestRunner<'a>

§

impl<'a> UnsafeUnpin for TestRunner<'a>

§

impl<'a> UnwindSafe for TestRunner<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.