#![allow(clippy::multiple_crate_versions)]
pub mod assertions;
pub mod objects;
pub mod output;
pub mod suite;
pub mod unit;
#[macro_export]
macro_rules! assert_that {
($title:expr,$description:expr,$time:expr,$callbacks:expr) => {
Assert::it($title, $description, $time, $callbacks);
};
}
#[macro_export]
macro_rules! check_that {
($title:expr,$description:expr,$time:expr,$callbacks:expr) => {
Unit::it($title, $description, $time, $callbacks);
};
}
#[macro_export]
macro_rules! always_panic {
() => {
std::panic::set_hook(Box::new(|_| {}));
panic!("");
};
}
#[macro_export]
macro_rules! run {
($t:expr,$s:expr,$e:expr,$before:ident,$after:ident) => {
$before();
std::panic::set_hook(Box::new(|_| {
println!(
"{}\n",
format_args!("\t\t{} {}", "*".red().bold(), $e.red().blink().bold())
);
}));
if $t.eq(&false) {
panic!("");
}
println!(
"{}\n",
format_args!(
"\t\t{} {}",
"".true_color(55, 190, 176).bold(),
$s.true_color(55, 190, 176).bold()
)
);
$after();
std::thread::sleep(std::time::Duration::from_millis(50));
};
}
#[macro_export]
macro_rules! it {
($title:expr,$description:expr,$before_all:ident,$before:ident,$after_all:ident,$after:ident,$main:ident) => {
assert!($crate::suite::describe(
$title,
$description,
$after_all,
$after,
$before_all,
$before,
$main,
)
.end()
.is_ok());
};
}