pub struct Unit { /* private fields */ }Implementations§
source§impl Unit
impl Unit
sourcepub fn describe(
&mut self,
description: &str,
it: fn(_: &mut Unit) -> &mut Unit
) -> &mut Unit
pub fn describe( &mut self, description: &str, it: fn(_: &mut Unit) -> &mut Unit ) -> &mut Unit
Group test in a function
descriptionThe group test descriptionitThe callback to execute
sourcepub fn new(description: &str, time: u64, s: Style) -> Unit
pub fn new(description: &str, time: u64, s: Style) -> Unit
Unit constructor
descriptionThe unit test descriptiontimeThe sleep time
sourcepub fn ok(&mut self, b: bool) -> &mut Unit
pub fn ok(&mut self, b: bool) -> &mut Unit
Check if all values are equals to true
bA value to check
sourcepub fn ko(&mut self, b: bool) -> &mut Unit
pub fn ko(&mut self, b: bool) -> &mut Unit
Check if all values are equals to false
bThe value to check
sourcepub fn equals<T: PartialEq>(&mut self, a: T, b: T) -> &mut Unit
pub fn equals<T: PartialEq>(&mut self, a: T, b: T) -> &mut Unit
Check if two value are equals
aThe first valuebThe second value
sourcepub fn between<T: PartialOrd>(&mut self, actual: T, min: T, max: T) -> &mut Unit
pub fn between<T: PartialOrd>(&mut self, actual: T, min: T, max: T) -> &mut Unit
Check if actual is in min and []ax value
actualThe actual valueminThe minimun value for actualmaxThe maximum value for actual
sourcepub fn unequals<T: PartialEq>(&mut self, a: T, b: T) -> &mut Unit
pub fn unequals<T: PartialEq>(&mut self, a: T, b: T) -> &mut Unit
Check if values are unequals
aThe first valuebThe second value
sourcepub fn inferior<T: PartialOrd>(&mut self, actual: T, max: T) -> &mut Unit
pub fn inferior<T: PartialOrd>(&mut self, actual: T, max: T) -> &mut Unit
Check if the value is inferior to the maximum value
actualThe actual valuemaxThe maximum value
sourcepub fn superior<T: PartialOrd>(&mut self, actual: T, min: T) -> &mut Unit
pub fn superior<T: PartialOrd>(&mut self, actual: T, min: T) -> &mut Unit
Check if the value is superior to the minimun value
actualThe actual valueminThe minimum value
sourcepub fn not_empty(&mut self, x: &str) -> &mut Unit
pub fn not_empty(&mut self, x: &str) -> &mut Unit
Check if a string is not empty
xThe string to check
sourcepub fn contains(&mut self, x: &str, expected: &str) -> &mut Unit
pub fn contains(&mut self, x: &str, expected: &str) -> &mut Unit
Check if a string contains another string
xThe string to checkexpectedThe string to verify
sourcepub fn not_contains(&mut self, x: &str, expected: &str) -> &mut Unit
pub fn not_contains(&mut self, x: &str, expected: &str) -> &mut Unit
Check if a string not contains another string
xThe string to checkexpectedThe string to verify
sourcepub fn empty(&mut self, x: &str) -> &mut Unit
pub fn empty(&mut self, x: &str) -> &mut Unit
Check if a string is empty
xThe string to check
sourcepub fn is_directory(&mut self, d: &str) -> &mut Unit
pub fn is_directory(&mut self, d: &str) -> &mut Unit
Check if the given value is a directory
dThe path to check
sourcepub fn is_not_directory(&mut self, d: &str) -> &mut Unit
pub fn is_not_directory(&mut self, d: &str) -> &mut Unit
Check if the given value is not a directory
dThe path to check
sourcepub fn is_file(&mut self, f: &str) -> &mut Unit
pub fn is_file(&mut self, f: &str) -> &mut Unit
Check if the given value is a file
fThe path to check
sourcepub fn path_start_with(&mut self, path: &str, base: &str) -> &mut Unit
pub fn path_start_with(&mut self, path: &str, base: &str) -> &mut Unit
Chek if a path start with a expected base
pathThe path to checkbaseThe path’s base
sourcepub fn path_absolute(&mut self, path: &str) -> &mut Unit
pub fn path_absolute(&mut self, path: &str) -> &mut Unit
Chek if a path is absolute
pathThe path to check
sourcepub fn path_not_absolute(&mut self, path: &str) -> &mut Unit
pub fn path_not_absolute(&mut self, path: &str) -> &mut Unit
Chek if a path is not absolute
pathThe path to check
sourcepub fn path_exists(&mut self, path: &str) -> &mut Unit
pub fn path_exists(&mut self, path: &str) -> &mut Unit
Chek if a path exist
pathThe path to check
sourcepub fn path_not_relative(&mut self, path: &str) -> &mut Unit
pub fn path_not_relative(&mut self, path: &str) -> &mut Unit
Chek if a path is not relative
pathThe path to check
sourcepub fn is_executable(&mut self, path: &str) -> &mut Unit
pub fn is_executable(&mut self, path: &str) -> &mut Unit
Chek if a path is not relative
pathThe path to check
sourcepub fn is_not_executable(&mut self, path: &str) -> &mut Unit
pub fn is_not_executable(&mut self, path: &str) -> &mut Unit
Chek if a path is relative
pathThe path to check
sourcepub fn path_symlink(&mut self, path: &str) -> &mut Unit
pub fn path_symlink(&mut self, path: &str) -> &mut Unit
Chek if a path is relative
pathThe path to check
sourcepub fn path_relative(&mut self, path: &str) -> &mut Unit
pub fn path_relative(&mut self, path: &str) -> &mut Unit
Chek if a path exist
pathThe path to check
sourcepub fn path_no_exists(&mut self, path: &str) -> &mut Unit
pub fn path_no_exists(&mut self, path: &str) -> &mut Unit
Chek if a path is not absolute
pathThe path to check
sourcepub fn file_contains(&mut self, file: &str, expected: &str) -> &mut Unit
pub fn file_contains(&mut self, file: &str, expected: &str) -> &mut Unit
Check if a file contains an another string
fileThe path to checkexpectedThe expected value
sourcepub fn file_no_contains(&mut self, file: &str, expected: &str) -> &mut Unit
pub fn file_no_contains(&mut self, file: &str, expected: &str) -> &mut Unit
Check if a file no contains an another string
fileThe path to checkexpectedThe unexpected value
sourcepub fn theory<T: PartialEq>(&mut self, t: T, expected: T) -> &mut Unit
pub fn theory<T: PartialEq>(&mut self, t: T, expected: T) -> &mut Unit
Check if the theory is true
tThe theory resultexpectedThe theory expected result
sourcepub fn vec_length_equals<T: PartialEq>(
&mut self,
a: Vec<T>,
b: Vec<T>
) -> &mut Unit
pub fn vec_length_equals<T: PartialEq>( &mut self, a: Vec<T>, b: Vec<T> ) -> &mut Unit
Check if two vec length are equals
aThe first vectorbThe second vector
sourcepub fn vec_length_unequals<T: PartialEq>(
&mut self,
a: Vec<T>,
b: Vec<T>
) -> &mut Unit
pub fn vec_length_unequals<T: PartialEq>( &mut self, a: Vec<T>, b: Vec<T> ) -> &mut Unit
Check if two vec length are unequals
aThe first vectorbThe second vector
sourcepub fn vec_contains<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Unit
pub fn vec_contains<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Unit
Check if a vec contains a value
aThe vectorbThe value
sourcepub fn vec_no_contains<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Unit
pub fn vec_no_contains<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Unit
Check if a vec not contains a value
aThe vectorbThe value
sourcepub fn vec_start_with<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Unit
pub fn vec_start_with<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Unit
Check if a vec start with a value
aThe vectorbThe value
sourcepub fn vec_no_start_with<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Unit
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
aThe vectorbThe value
sourcepub fn vec_end_with<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Unit
pub fn vec_end_with<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Unit
Check if a vec finnish with a value
aThe vectorbThe value
sourcepub fn vec_no_end_with<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Unit
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
aThe vectorbThe value
sourcepub fn vec_empty<T: PartialEq>(&mut self, a: Vec<T>) -> &mut Unit
pub fn vec_empty<T: PartialEq>(&mut self, a: Vec<T>) -> &mut Unit
Check if a vec is empty
aThe vector
sourcepub fn vec_not_empty<T: PartialEq>(&mut self, a: Vec<T>) -> &mut Unit
pub fn vec_not_empty<T: PartialEq>(&mut self, a: Vec<T>) -> &mut Unit
Check if a vec is not empty
aThe vector
sourcepub fn full(&mut self, callback: fn() -> usize, max: usize) -> &mut Unit
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
callbackThe callback to checkmaxThe callback maximum value
sourcepub fn not_full(&mut self, callback: fn() -> usize, max: usize) -> &mut Unit
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
callbackThe callback to checkmaxThe callback maximum value
sourcepub fn prime(&mut self, x: usize) -> &mut Unit
pub fn prime(&mut self, x: usize) -> &mut Unit
Check if the value is a prime number
xThe value to check
sourcepub fn pair(&mut self, x: usize) -> &mut Unit
pub fn pair(&mut self, x: usize) -> &mut Unit
Check if the value is a pair number
xThe value to check
sourcepub fn impair(&mut self, x: usize) -> &mut Unit
pub fn impair(&mut self, x: usize) -> &mut Unit
Check if the value is an impair number
xThe value to check
Auto Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more