Unit

Struct Unit 

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

Implementations§

Source§

impl Unit

§To run unit test

Source

pub fn see(url: &str, expected: &str) -> bool

Source

pub fn equals_bytes(&mut self, actual: &str, expected: &[u8]) -> &mut Unit

Source

pub fn unequals_bytes(&mut self, actual: &str, expected: &[u8]) -> &mut Unit

Source

pub fn begin_with(&mut self, actual: &str, expected: &str) -> &mut Unit

Source

pub fn finnish_with(&mut self, actual: &str, expected: &str) -> &mut Unit

Source

pub fn exe(&mut self, filename: &str) -> &mut Unit

§Test if a file is an executable
  • filename The filename to test
Source

pub fn not_exe(&mut self, filename: &str) -> &mut Unit

Source

pub fn describe( &mut self, description: &str, it: fn(&mut Unit) -> &mut Unit, ) -> &mut Unit

§Group test in a function
  • description The group test description
  • it The callback to execute
Source

pub fn title(&mut self, description: &str)

Source

pub fn theory(&mut self, description: &str, it: fn() -> bool) -> &mut Unit

Source

pub fn chaos(&mut self, description: &str, it: fn() -> bool) -> &mut Unit

§Check if a theory match false
  • description THe theory description
  • it The callback to execute
Source

pub fn new(description: &str, time: u64, s: Style) -> Unit

§Unit constructor
  • description The unit test description
  • time The sleep time
Source

pub fn end(&mut self) -> Result<String, String>

End of the tests

Source

pub fn ok(&mut self, b: bool) -> &mut Unit

§Check if all values are equals to true
  • b A value to check
Source

pub fn ko(&mut self, b: bool) -> &mut Unit

§Check if all values are equals to false
  • b The value to check
Source

pub fn equals<T: PartialEq>(&mut self, a: T, b: T) -> &mut Unit

§Check if two value are equals
  • a The first value
  • b The second value
Source

pub fn between<T: PartialOrd>(&mut self, actual: T, min: T, max: T) -> &mut Unit

§Check if actual is in min and []ax value
  • actual The actual value
  • min The minimun value for actual
  • max The maximum value for actual
Source

pub fn unequals<T: PartialEq>(&mut self, a: T, b: T) -> &mut Unit

Check if values are unequals

  • a The first value
  • b The second value
Source

pub fn inferior<T: PartialOrd>(&mut self, actual: T, max: T) -> &mut Unit

§Check if the value is inferior to the maximum value
  • actual The actual value
  • max The maximum value
Source

pub fn superior<T: PartialOrd>(&mut self, actual: T, min: T) -> &mut Unit

§Check if the value is superior to the minimun value
  • actual The actual value
  • min The minimum value
Source

pub fn not_empty(&mut self, x: &str) -> &mut Unit

§Check if a string is not empty
  • x The string to check
Source

pub fn contains(&mut self, x: &str, expected: &str) -> &mut Unit

§Check if a string contains another string
  • x The string to check
  • expected The string to verify
Source

pub fn not_contains(&mut self, x: &str, expected: &str) -> &mut Unit

§Check if a string not contains another string
  • x The string to check
  • expected The string to verify
Source

pub fn empty(&mut self, x: &str) -> &mut Unit

§Check if a string is empty
  • x The string to check
Source

pub fn is_directory(&mut self, d: &str) -> &mut Unit

§Check if the given value is a directory
  • d The path to check
Source

pub fn is_not_directory(&mut self, d: &str) -> &mut Unit

§Check if the given value is not a directory
  • d The path to check
Source

pub fn is_file(&mut self, f: &str) -> &mut Unit

§Check if the given value is a file
  • f The path to check
Source

pub fn path_start_with(&mut self, path: &str, base: &str) -> &mut Unit

§Chek if a path start with a expected base
  • path The path to check
  • base The path’s base
Source

pub fn path_absolute(&mut self, path: &str) -> &mut Unit

§Chek if a path is absolute
  • path The path to check
Source

pub fn path_not_absolute(&mut self, path: &str) -> &mut Unit

§Chek if a path is not absolute
  • path The path to check
Source

pub fn path_exists(&mut self, path: &str) -> &mut Unit

§Chek if a path exist
  • path The path to check
Source

pub fn path_not_relative(&mut self, path: &str) -> &mut Unit

§Chek if a path is not relative
  • path The path to check
Source

pub fn is_executable(&mut self, path: &str) -> &mut Unit

§Chek if a path is not relative
  • path The path to check
Source

pub fn is_not_executable(&mut self, path: &str) -> &mut Unit

§Chek if a path is relative
  • path The path to check
§Chek if a path is relative
  • path The path to check
Source

pub fn path_relative(&mut self, path: &str) -> &mut Unit

§Chek if a path exist
  • path The path to check
Source

pub fn path_no_exists(&mut self, path: &str) -> &mut Unit

§Chek if a path is not absolute
  • path The path to check
Source

pub fn file_contains(&mut self, file: &str, expected: &str) -> &mut Unit

§Check if a file contains an another string
  • file The path to check
  • expected The expected value
Source

pub fn file_no_contains(&mut self, file: &str, expected: &str) -> &mut Unit

§Check if a file no contains an another string
  • file The path to check
  • expected The unexpected value
Source

pub fn vec_length_equals<T: PartialEq>( &mut self, a: Vec<T>, b: Vec<T>, ) -> &mut Unit

§Check if two vec length are equals
  • a The first vector
  • b The second vector
Source

pub fn vec_length_unequals<T: PartialEq>( &mut self, a: Vec<T>, b: Vec<T>, ) -> &mut Unit

§Check if two vec length are unequals
  • a The first vector
  • b The second vector
Source

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

§Check if a vec contains a value
  • a The vector
  • b The value
Source

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

§Check if a vec not contains a value
  • a The vector
  • b The value
Source

pub fn vec_start_with<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Unit

§Check if a vec start with a value
  • a The vector
  • b The value
Source

pub fn vec_no_start_with<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Unit

§Check if a vec no start with a value
  • a The vector
  • b The value
Source

pub fn vec_end_with<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Unit

§Check if a vec finnish with a value
  • a The vector
  • b The value
Source

pub fn vec_no_end_with<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Unit

§Check if a vec finnish with a value
  • a The vector
  • b The value
Source

pub fn vec_empty<T: PartialEq>(&mut self, a: Vec<T>) -> &mut Unit

§Check if a vec is empty
  • a The vector
Source

pub fn vec_not_empty<T: PartialEq>(&mut self, a: Vec<T>) -> &mut Unit

§Check if a vec is not empty
  • a The vector
Source

pub fn full(&mut self, callback: fn() -> usize, max: usize) -> &mut Unit

§Check if the return of the callback is not at this maximum value
  • callback The callback to check
  • max The callback maximum value
Source

pub fn not_full(&mut self, callback: fn() -> usize, max: usize) -> &mut Unit

§Check if the return of the callback is not at this maximum value
  • callback The callback to check
  • max The callback maximum value
Source

pub fn prime(&mut self, x: usize) -> &mut Unit

§Check if the value is a prime number
  • x The value to check
Source

pub fn pair(&mut self, x: usize) -> &mut Unit

§Check if the value is a pair number
  • x The value to check
Source

pub fn impair(&mut self, x: usize) -> &mut Unit

§Check if the value is an impair number
  • x The value to check

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,