Quickstart - Native
- edit
cargo.toml
[dev-dependencies] sweet = # current version here [[example]] name = "sweet" path = "test/sweet.rs"
- create file
test/sweet.rs
#![feature(imported_main)] pub use sweet::*; #[sweet_test] fn it_works() -> Result<()>{ assert!(true == true); expect(true).to_be_true()?; expect("foobar") .not() .to_start_with("bazz")?; Ok(()) }
- run
cargo run --example sweet
- optional - try changing the above matchers so the test fails ⚡
As an example here is the output of a runner with a few tests: