summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Geary <rtgnj42@gmail.com>2019-10-13 20:32:00 -0400
committerRyan Geary <rtgnj42@gmail.com>2019-10-13 20:32:00 -0400
commite7169ea2e817874f9a1f71d55906e04a71aec558 (patch)
treeea734cb79b86ae74f9fdccfc7e78774fba30ec65
parentc204f99444d70d74969ac081fe6b36830b62e21a (diff)
Add print_out_of_order test
-rw-r--r--src/choice.rs15
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!(