Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. assert_that!(Some(5)).must_be(Some(5));
  2. assert_that!(Some(5)).must_be_some_and(|val| {
  3. assert_that!(val).must_be(5)
  4. }).with_msg("lazy evaluation");
  5. Some(5).must_be_some_and(|val| {
  6. assert_that!(val).must_be(5)
  7. });
  8.  
  9. // with customization
  10. let parser: fn(&str) -> Result<Lit, ParseError> = parse_lit;
  11. parser.must_parse("false").as_ok(Lit::Bool(false));
  12. assert_that!(parser)
  13. .with_msg("")
  14. .must_parse("true")
  15. .as_ok(Lit::Bool(true))
  16. .with_remainder(""); // rustfmt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement