Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- assert_that!(Some(5)).must_be(Some(5));
- assert_that!(Some(5)).must_be_some_and(|val| {
- assert_that!(val).must_be(5)
- }).with_msg("lazy evaluation");
- Some(5).must_be_some_and(|val| {
- assert_that!(val).must_be(5)
- });
- // with customization
- let parser: fn(&str) -> Result<Lit, ParseError> = parse_lit;
- parser.must_parse("false").as_ok(Lit::Bool(false));
- assert_that!(parser)
- .with_msg("")
- .must_parse("true")
- .as_ok(Lit::Bool(true))
- .with_remainder(""); // rustfmt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement