diff options
| author | Teddy Wing | 2016-04-06 01:12:58 -0400 |
|---|---|---|
| committer | Teddy Wing | 2016-04-06 01:12:58 -0400 |
| commit | 02688030cb7b1de5c63732b8b820017391bfd2a0 (patch) | |
| tree | a4723464e79c07d7e4c13d7509b51dc9b8b03637 /src/main.rs | |
| parent | 9b178d48e0aa218bdb2fccaf46f2ce40c3148c7e (diff) | |
| download | mutt-alias-auto-add-02688030cb7b1de5c63732b8b820017391bfd2a0.tar.bz2 | |
Add a couple tests for `build_alias`
Create a new `tests` module. This lives in its own file. Not sure if
this is idiomatic Rust, but I prefer the idea of my tests living in a
different file from my code. This module gets included in `main.rs`.
We `use` `build_alias` directly because it's currently a private
function, so doing `use super::*` didn't import it. Not sure if I should
be making it a public function in order to mitigate this.
Add a couple of variant test cases to check the string transformation
that this function should be doing.
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 3e4a343..92ea8e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,8 @@ use std::io::{self, BufRead}; +#[cfg(test)] +mod tests; + fn handle_alias(s: &str) { let alias = build_alias(s); } |
