diff options
| author | Teddy Wing | 2016-04-17 21:32:53 -0400 |
|---|---|---|
| committer | Teddy Wing | 2016-04-17 21:32:53 -0400 |
| commit | ad2d9e0e1fa965ef94fcbf6e239729008cc34ba2 (patch) | |
| tree | a09d63f4c19165cb3fb6a3fd66f05f4f38cffd6c /src/tests.rs | |
| parent | 9240db56a7202b238b7880da9c82b1e73089f02e (diff) | |
| download | mutt-alias-auto-add-ad2d9e0e1fa965ef94fcbf6e239729008cc34ba2.tar.bz2 | |
Create a function that will check whether an alias is in a file
This will allow us to pass an alias and grep for it in a given file.
Just a rough outline to start. Added a super basic test and a file in
"testdata" to operate on for testing.
Diffstat (limited to 'src/tests.rs')
| -rw-r--r-- | src/tests.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/tests.rs b/src/tests.rs index 2e43d35..712b41e 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -1,4 +1,4 @@ -use super::build_alias; +use super::{build_alias, is_alias_in_file}; #[test] fn build_alias_with_only_email() { @@ -39,3 +39,12 @@ fn build_alias_with_special_characters() { build_alias("From: \"O'Strulson, Celty\" <celty@dollars.co>") ); } + + +#[test] +fn is_alias_in_file_finds_a_match() { + is_alias_in_file( + "alias farnsworth-hubert Hubert Farnsworth <professor@planetexpress.com>", + "./testdata/aliases" + ); +} |
