To run unit test for your rust applications
sh
cargo add unit-testing
```toml
[package]
name = "
[lib]
name = "
[[bin]] name = "unit-testing" path = "src/bin.rs"
[dependencies] coloredtruecolor = "0.1.0" mockall = "0.11.3" progressbar = "1.0.3" unit-testing = "0.3.2" ```
```rust use unit::zuu::Unit;
fn kool() -> bool { return false; }
fn look() -> bool { return true; }
fn s() -> i32 { return 0; }
fn f() -> i32 { return 1; }
fn get_fans() -> i32 { return 5; }
fn main() { assert!(Unit::new("Test the unit framework") .failure(&f).success(&s).expect(kool(), false).expect(look(), true).expect(f(), 1).expect(s(), 0) .equals(&s, 0) .equals(&f, 1) .success(&s).failure(&f) .contains("I love linux", "linux") .finnish("I love linux", "linux") .begin("Linux it's the best", "Linux") .contains("Linux is superb", "Linux") .different("linux", "windows") .chaos("windows love linux", &kool) .theory("windows love linux", &look, true) .between(&getfans, 1, 10) .inferior(&getfans, 10) .superior(&getfans, 1) .exist("/home") .empty("") .notempty(" ") .has("window love linux", "linux") .defined("linux") .not("linux", "windows") .end() .is_ok()); } ```
shell
./target/debug/unit-testing