#[macro_use] extern crate must; use must::prelude::*; #[test] #[should_panic] fn test() { String::from("A").must_be("B").or(fail!()); } #[test] #[should_panic] fn test_it() { let val = "TTT"; val.must_be("FAIL").or(fail!()); } #[test] #[should_panic(expected = "Custom Message")] fn custom_msg() { "TTT".must_be("FAIL").or(fail!("Custom Message")); } #[test] #[should_panic(expected = "custom message with format arg")] fn custom_msg_fmt() { let current = "custom message with format arg"; "TTT".must_be("FAIL").or(fail!("{}", current)); }