diff options
| author | Teddy Wing | 2016-04-21 15:59:50 -0400 |
|---|---|---|
| committer | Teddy Wing | 2016-04-21 15:59:50 -0400 |
| commit | f2ac8f66358bac4bcc6f3588bb55ffba9d9fecac (patch) | |
| tree | 0dbd49a079497a0657579df861ce6145ef523352 /src | |
| parent | 763d47befd80547f12525c01cc5a103d1ef5f285 (diff) | |
| download | mutt-alias-auto-add-f2ac8f66358bac4bcc6f3588bb55ffba9d9fecac.tar.bz2 | |
Add a test for the `AliasSearchError::NotFound` case
When the given alias being searched for does not appear in the alias
file, a `NotFound` error should be returned.
Diffstat (limited to 'src')
| -rw-r--r-- | src/tests.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/tests.rs b/src/tests.rs index a6f2777..0a512a1 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -55,3 +55,18 @@ fn find_alias_in_file_email_already_exists() { ) ); } + +#[test] +fn find_alias_in_file_alias_is_new() { + assert_eq!( + Err(AliasSearchError::NotFound), + find_alias_in_file( + &Alias { + alias: "fry-philip".to_owned(), + name: "Philip Fry".to_owned(), + email: "<fry@planetexpress.com>".to_owned() + }, + "./testdata/aliases" + ) + ); +} |
