1
Fork 0

Test for leading and trailing whitespace.

This commit is contained in:
Bauke 2022-04-02 14:42:00 +02:00
parent ad35ded233
commit cf5a6497e5
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 10 additions and 0 deletions

View File

@ -10,6 +10,16 @@ const HOLLLO_HASH: &str = "ebff9105dce4954b1bdb57fdab079ff3";
fn test_hash_email() { fn test_hash_email() {
assert_eq!(Generator::hash_email(BAUKE_EMAIL), BAUKE_HASH); assert_eq!(Generator::hash_email(BAUKE_EMAIL), BAUKE_HASH);
assert_eq!(Generator::hash_email(HOLLLO_EMAIL), HOLLLO_HASH); assert_eq!(Generator::hash_email(HOLLLO_EMAIL), HOLLLO_HASH);
// Make sure leading and trailing whitespace is removed.
assert_eq!(
Generator::hash_email(&format!(" {BAUKE_EMAIL} ")),
BAUKE_HASH
);
assert_eq!(
Generator::hash_email(&format!(" {HOLLLO_EMAIL} ")),
HOLLLO_HASH
);
} }
#[test] #[test]