stress_test/
stress_test.rs

1use evil_id::EvilID;
2
3fn main() {
4    let mut errors: u64 = 0;
5
6    for i in 1..=100000 {
7        let id = EvilID::generate();
8
9        let string = id.get();
10
11        let rebuilt_id = EvilID::new_from(string.clone());
12
13        match rebuilt_id {
14            Err(_) => {
15                errors += 1;
16                println!("Error rebuilding id {} on index {i}.", string.clone())
17            }
18            Ok(rebuilt_id) => {
19                if id != rebuilt_id {
20                    println!("Rebuilt ID from {string} doesn't match original on index {i}.");
21                }
22            }
23        }
24    }
25
26    if errors == 0 {
27        println!("Test went with no errors whatsoever.");
28    } else {
29        println!("{errors} errors found!");
30    }
31}