pub struct Unit { /* private fields */ }Implementations§
Source§impl Unit
§To run unit test
impl Unit
§To run unit test
pub fn see(url: &str, expected: &str) -> bool
pub fn equals_bytes(&mut self, actual: &str, expected: &[u8]) -> &mut Unit
pub fn unequals_bytes(&mut self, actual: &str, expected: &[u8]) -> &mut Unit
pub fn begin_with(&mut self, actual: &str, expected: &str) -> &mut Unit
pub fn finnish_with(&mut self, actual: &str, expected: &str) -> &mut Unit
Sourcepub fn exe(&mut self, filename: &str) -> &mut Unit
pub fn exe(&mut self, filename: &str) -> &mut Unit
§Test if a file is an executable
filenameThe filename to test
pub fn not_exe(&mut self, filename: &str) -> &mut 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
pub fn title(&mut self, description: &str)
pub fn theory(&mut self, description: &str, it: fn() -> bool) -> &mut Unit
Sourcepub fn chaos(&mut self, description: &str, it: fn() -> bool) -> &mut Unit
pub fn chaos(&mut self, description: &str, it: fn() -> bool) -> &mut Unit
§Check if a theory match false
descriptionTHe theory 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 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
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> 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