not_modifier/
not_modifier.rs1use rest::prelude::*;
2
3fn main() {
4 config().enhanced_output(true).apply();
6
7 println!("Running not modifier examples");
8
9 expect!(5).not().to_equal(10);
13
14 expect_not!(5).to_equal(10);
16
17 let name = "John Doe";
21 expect!(name).not().to_be_empty();
22 expect!(name).not().to_have_length(5);
23 expect!(name).not().to_contain("Smith");
24 expect!(name).not().to_start_with("Bob");
25 expect!(name).not().to_end_with("Smith");
26 expect!(name).not().to_match("^Smith");
27
28 let age = 30;
30 expect!(age).not().to_be_greater_than(50); expect!(age).not().to_be_less_than(20); expect!(age).not().to_be_odd(); expect!(age).not().to_be_negative(); expect!(age).not().to_be_in_range(40..50); let value = 42;
38 expect!(value).not().to_equal(100); expect_not!(value).to_equal(100); println!("All examples passed!");
42}