This commit is contained in:
Ryan Geary 2019-10-24 21:05:09 -04:00
parent f662219407
commit c729ad3f00

View file

@ -79,13 +79,12 @@ impl Choice {
}, },
}; };
if self.is_reverse_range() { if self.is_reverse_range() {
slices.reverse(); slices.reverse();
}
return slices;
} }
return slices;
}
} }
#[cfg(test)] #[cfg(test)]
@ -155,7 +154,7 @@ mod tests {
#[test] #[test]
fn print_1_to_3() { fn print_1_to_3() {
let config = Config::from_iter(vec!["choose", "1:3" ]); let config = Config::from_iter(vec!["choose", "1:3"]);
assert_eq!( assert_eq!(
vec!["is", "pretty", "cool"], vec!["is", "pretty", "cool"],
config.opt.choice[0] config.opt.choice[0]
@ -222,10 +221,8 @@ mod tests {
let config = Config::from_iter(vec!["choose", "3:1"]); let config = Config::from_iter(vec!["choose", "3:1"]);
assert_eq!( assert_eq!(
vec!["pretty", "is", "lang"], vec!["pretty", "is", "lang"],
config.opt.choice[0].get_choice_slice( config.opt.choice[0]
&String::from("rust lang is pretty darn cool"), .get_choice_slice(&String::from("rust lang is pretty darn cool"), &config)
&config
)
); );
} }