diff options
author | Ryan Geary <rtgnj42@gmail.com> | 2019-10-13 20:32:00 -0400 |
---|---|---|
committer | Ryan Geary <rtgnj42@gmail.com> | 2019-10-13 20:32:00 -0400 |
commit | e7169ea2e817874f9a1f71d55906e04a71aec558 (patch) | |
tree | ea734cb79b86ae74f9fdccfc7e78774fba30ec65 | |
parent | c204f99444d70d74969ac081fe6b36830b62e21a (diff) |
Add print_out_of_order test
-rw-r--r-- | src/choice.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/choice.rs b/src/choice.rs index d3485a4..0b48a68 100644 --- a/src/choice.rs +++ b/src/choice.rs @@ -106,6 +106,21 @@ mod tests { } #[test] + fn print_out_of_order() { + let config = Config::from_iter(vec!["choose", "3", "1"]); + assert_eq!( + vec!["cool"], + config.opt.choice[0] + .get_choice_slice(&String::from("rust is pretty cool"), &config) + ); + assert_eq!( + vec!["is"], + config.opt.choice[1] + .get_choice_slice(&String::from("rust is pretty cool"), &config) + ); + } + + #[test] fn print_1_to_3() { let config = Config::from_iter(vec!["choose", "1:3"]); assert_eq!( |