Files
compression/src/test.rs
T
2026-08-29 16:45:39 +02:00

34 lines
867 B
Rust

#[cfg(test)]
mod tests {
use std::collections::HashMap;
use crate::{create_tree, get_stats};
use super::*;
#[test]
fn check_basic_functions() {
let test = get_stats("ZEHTZJATJAEJEF".to_string());
let case = HashMap::from([
("Z".to_string(), 2),
("E".to_string(), 3),
("H".to_string(), 1),
("T".to_string(), 2),
("J".to_string(), 3),
("A".to_string(), 2),
("F".to_string(), 1),
]);
println!("{:?} \n {:?}", test, case);
assert!(test == case);
}
#[test]
fn test2() {
let small_string : String = "aaaaaaaaaaaaaaaaaaa a a a a a a a bazbazoreb kjzbej kjqbzetjbqzefe jabzezf jbzaefe jbzae ljzbef ljsndsf lj".to_string();
let stats = get_stats(small_string);
create_tree(stats);
}
}