diff --git a/src/lib.rs b/src/lib.rs index 387f566..1795a02 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -185,7 +185,7 @@ impl Unquote for String { #[cfg(test)] mod test { - use crate::{from_base36, ToBase36, optional_data_line, mock, segments_from_string, Quote, Unquote}; + use crate::{from_base36, ToBase36, optional_data_line, mock, segments_from_string, Quote, Unquote, new_unique_id}; #[test] fn test_from_base36() { @@ -234,4 +234,11 @@ mod test { let expected = "who the fuck is scraeming \"LOG OFF\" at my house.\nshow yourself, coward.\ni will never log off".to_string(); assert_eq!(output, expected); } + + #[test] + fn test_new_unique_id() { + assert_eq!(new_unique_id(vec!["0".to_string(), "2".to_string()]), "1".to_string()); + assert_eq!(new_unique_id(vec!["0".to_string(), "1".to_string()]), "2".to_string()); + assert_eq!(new_unique_id(vec!["1".to_string(), "z".to_string()]), "0".to_string()); + } }