aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests.rs
diff options
context:
space:
mode:
authorTeddy Wing2016-04-06 12:55:56 -0400
committerTeddy Wing2016-04-06 12:55:56 -0400
commitde3a9b7f68e1f1b368630f498dd338d8b50444c8 (patch)
treec6111f6818efc1d25f2a522f177770ec94c68199 /src/tests.rs
parentcad8246ab54f7c81b70d1445ccac356bc4b06d02 (diff)
downloadmutt-alias-auto-add-de3a9b7f68e1f1b368630f498dd338d8b50444c8.tar.bz2
build_alias: Remove [,'"] characters
Make the function a bit more DRY by taking the `push_str` calls out of the `if` block. Add a new test and some code to remove commas and quotes from aliases.
Diffstat (limited to 'src/tests.rs')
-rw-r--r--src/tests.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tests.rs b/src/tests.rs
index eff385a..f5fb57f 100644
--- a/src/tests.rs
+++ b/src/tests.rs
@@ -21,4 +21,9 @@ fn test_build_alias() {
"alias lab-harvard Harvard Innovation Lab <noreply@eventbrite.com>",
build_alias("From: Harvard Innovation Lab <noreply@eventbrite.com>")
);
+
+ assert_eq!(
+ "alias celty-ostrulson \"O'Strulson, Celty\" <celty@dollars.co>",
+ build_alias("From: \"O'Strulson, Celty\" <celty@dollars.co>")
+ );
}