conjugation/
conjugation.rs

1use rest::prelude::*;
2
3fn main() {
4    // Enable enhanced output for this example
5    config().enhanced_output(true).apply();
6
7    println!("Testing verb conjugation in assertions\n");
8
9    println!("=== Testing singular vs plural variable names ===");
10
11    // Singular variable names
12    let number = 42;
13    let value = 42;
14    let item = "hello";
15    let element = [1, 2, 3];
16
17    expect!(number).to_be_even(); // Should be "number is even"
18    expect!(value).to_be_positive(); // Should be "value is positive"
19    expect!(item).to_have_length(5); // Should be "item has length 5"
20    expect!(&element).to_have_length(3); // Should be "element has length 3"
21
22    // Plural variable names
23    let numbers = vec![1, 2, 3, 4, 5];
24    let values = vec![10, 20, 30];
25    let items = ["a", "b", "c"];
26    let elements = [5, 6, 7];
27
28    expect!(numbers.as_slice()).to_have_length(5); // Should be "numbers have length 5"
29    expect!(values.as_slice()).to_have_length(3); // Should be "values have length 3"
30    expect!(&items).to_contain("b"); // Should be "items contain 'b'"
31    expect!(&elements).to_have_length(3); // Should be "elements have length 3"
32
33    println!("\n=== Testing logical chains ===");
34
35    // Singular with chains
36    expect!(number).to_be_greater_than(30).and().to_be_less_than(50); // Should be "number is greater than 30 AND be less than 50"
37
38    // Plural with chains
39    expect!(numbers.as_slice()).to_have_length(5).and().to_contain(3); // Should be "numbers have length 5 AND contain 3"
40
41    // Mixed cases
42    let user = "John";
43    let users = ["John", "Alice", "Bob"];
44
45    expect!(user).to_equal("John"); // Should be "user is equal to 'John'"
46    expect!(&users).to_contain("Alice"); // Should be "users contain 'Alice'"
47
48    rest::Reporter::summarize();
49}