basic/basic.rs
1use fluent_test::prelude::*;
2
3fn main() {
4 // Enable enhanced output for this example
5 config().enhanced_output(true).apply();
6
7 // Just to demonstrate the API
8 let x = 42;
9 let name = "Arthur";
10
11 // Integer tests - direct and by reference
12 expect!(x).to_be_greater_than(30);
13 expect!(x).to_be_less_than(50);
14 expect!(x).to_be_even();
15
16 // Create a reference to demonstrate the & removal in output
17 let x_ref = &x;
18 expect!(x_ref).to_equal(&42);
19
20 // String tests - direct and by reference
21 expect!(name).to_contain("th");
22 expect!(name).to_have_length(6);
23
24 // Create a reference to demonstrate the & removal in output
25 let name_ref = &name;
26 let arthur = "Arthur";
27 expect!(name_ref).to_equal(&arthur);
28
29 // Report test results
30 fluent_test::Reporter::summarize();
31}