use std::collections::HashMap; #[test] fn mount_index() { let dict_input = "Zunix OS A Linux-based operating system, designed to be used in mainframes, regarding high reliability connections and security. (2015-01-01) "; let expected_index = HashMap::from([( String::from("zunix os"), vec![ "Zunix OS".to_string(), "".to_string(), " A Linux-based operating system, designed to be used".to_string(), "in mainframes, regarding high reliability connections and security.".to_string(), "".to_string(), "(2015-01-01)".to_string(), "".to_string(), "".to_string(), ], )]); let actual_index = vocabverse::mount_index(dict_input.to_string()); assert_eq!(expected_index, actual_index); } #[test] fn find_matches() { let index = HashMap::from([(String::from("test"), vec!["boom!".to_string()])]); let matches = vocabverse::find_matches(&String::from("tes"), &index); assert_eq!(vec![&String::from("test")], matches); }