diff options
| author | Teddy Wing | 2016-04-06 12:55:56 -0400 | 
|---|---|---|
| committer | Teddy Wing | 2016-04-06 12:55:56 -0400 | 
| commit | de3a9b7f68e1f1b368630f498dd338d8b50444c8 (patch) | |
| tree | c6111f6818efc1d25f2a522f177770ec94c68199 /src/tests.rs | |
| parent | cad8246ab54f7c81b70d1445ccac356bc4b06d02 (diff) | |
| download | mutt-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.rs | 5 | 
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>") +    );  } | 
