Skip to content

Commit

Permalink
tests: adds tests for did_you_mean suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
kbknapp committed Sep 4, 2015
1 parent 63dbc55 commit cfaae03
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/app/suggestions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,17 @@ pub enum DidYouMeanMessageStyle {
LongFlag,
/// Suggested value is one of various possible values
EnumValue,
}

#[cfg(test)]
mod test {
use super::*;

#[test]
fn did_you_mean_possible_values() {
let p_vals = ["test", "possible", "values"];
assert_eq!(did_you_mean("tst", p_vals.iter()), Some("test"));
assert!(did_you_mean("hahaahahah", p_vals.iter()).is_none());

}
}

0 comments on commit cfaae03

Please sign in to comment.