test new_unique_id()

This commit is contained in:
Max Bradbury 2020-06-23 16:23:24 +01:00
parent 280dea62ae
commit eb5a0f1344
1 changed files with 8 additions and 1 deletions

View File

@ -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());
}
}