Struct Unit

Source
pub struct Unit { /* private fields */ }
Expand description

§To run units tests

Trait Implementations§

Source§

impl Failure for Unit

Source§

fn command_fail( &mut self, callbacks: Vec<&dyn Fn() -> Result<ExitStatus, Error>>, ) -> &mut Self

Check if a command exit status is a failure code Read more
Source§

fn fail(&mut self, callbacks: Vec<&dyn Fn() -> bool>) -> &mut Self

Check if a callbacks return false Read more
Source§

impl Success for Unit

Source§

fn run( &mut self, callbacks: Vec<&dyn Fn() -> Result<ExitStatus, Error>>, ) -> &mut Self

Check if a command success Read more
Source§

fn success(&mut self, callbacks: Vec<&dyn Fn() -> bool>) -> &mut Self

Check if a callbacks return true Read more
Source§

impl Take for Unit

Source§

fn assert_that(&mut self, t: bool) -> bool

run assertion Read more
Source§

fn take(&mut self, t: bool, s: &str, e: &str) -> &mut Self

Run assert and measure execution time Read more
Source§

fn check(&mut self, t: bool, s: &str, e: &str)

Run an assert and measure the time Read more
Source§

impl Testable for Unit

Source§

fn matches(&mut self, pattern: &str, values: Vec<String>) -> &mut Self

Check if a pattern matches values Read more
Source§

fn capture( &mut self, pattern: &str, x: &str, key: usize, values: Vec<String>, ) -> &mut Self

check if a pattern the x index equals a value listing in values Read more
Source§

fn it( title: &str, description: &str, sleep_time: u64, callbacks: Vec<&dyn Fn(&mut Self) -> &mut Self>, )

Source§

fn ok(&mut self, f: bool) -> &mut Self

Assert if callback return true Read more
Source§

fn ko(&mut self, f: bool) -> &mut Self

Assert if callback return false Read more
Source§

fn assert(&mut self, test: bool) -> bool

Check if test pass Read more
Source§

fn eq<T: PartialEq>(&mut self, a: T, b: T) -> &mut Self

Check if a and b are equals Read more
Source§

fn ne<T: PartialEq>(&mut self, a: T, b: T) -> &mut Self

Check if a and b are unequals Read more
Source§

fn gt<T: PartialOrd>(&mut self, a: T, min: T) -> &mut Self

Check if a is superior to min Read more
Source§

fn ge<T: PartialOrd>(&mut self, a: T, max: T) -> &mut Self

Check if a is superior or equal to min Read more
Source§

fn lt<T: PartialOrd>(&mut self, a: T, max: T) -> &mut Self

Check if a is inferior to max Read more
Source§

fn le<T: PartialOrd>(&mut self, a: T, max: T) -> &mut Self

Source§

fn between<T: PartialOrd>(&mut self, a: T, min: T, max: T) -> &mut Self

Check if a is between min and max Read more
Source§

fn vec_contains<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Self

Check if a vector contains a value Read more
Source§

fn exe(&mut self, p: &str) -> &mut Self

Check if p is a program Read more
Source§

fn vec_no_contains<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Self

Check if a vector not contains a value Read more
Source§

fn option_contains<T: PartialEq>(&mut self, a: Option<T>, b: T) -> &mut Self

Check if an option contains a value Read more
Source§

fn hash_contains(&mut self, a: &mut HashSet<String>, b: String) -> &mut Self

Check if a hash contains a string Read more
Source§

fn str_contains(&mut self, a: &str, b: &str) -> &mut Self

Check if a sting contains a substring Read more
Source§

fn file_contains(&mut self, f: &str, v: &str) -> &mut Self

Check if a file contains a value Read more
Source§

fn exists(&mut self, p: &str) -> &mut Self

Check if a path exists Read more
Source§

fn not_exists(&mut self, p: &str) -> &mut Self

Check if a path not exists Read more
Source§

fn start_with(&mut self, actual: &str, expected: &str) -> &mut Self

Check if a string begins with the expected value Read more
Source§

fn end_with(&mut self, actual: &str, expected: &str) -> &mut Self

Check if a string finnish with the expected value Read more
Source§

fn end(&mut self) -> bool

Show assertions Read more
Source§

fn new(sleep_time: u64) -> Self

sleep_time The sleep time Read more
Source§

impl Theory for Unit

Source§

fn chaos(&mut self, callback: &dyn Fn() -> bool) -> &mut Self

A theory must be equal to false Read more
Source§

fn theory<T: PartialEq>( &mut self, expected: T, callback: &dyn Fn() -> T, ) -> &mut Self

Test a theory Read more
Source§

fn theorem<T: PartialEq>( &mut self, expected: T, actual: &dyn Fn() -> T, ) -> &mut Self

Check if a theorem is true Read more

Auto Trait Implementations§

§

impl !Freeze for Unit

§

impl !RefUnwindSafe for Unit

§

impl Send for Unit

§

impl !Sync for Unit

§

impl Unpin for Unit

§

impl UnwindSafe for Unit

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.