Skip to content

Commit

Permalink
test: simplify flag_using_long_with_literals
Browse files Browse the repository at this point in the history
  • Loading branch information
rami3l committed Aug 1, 2021
1 parent cf94a5b commit afc9477
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions tests/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,13 @@ fn flag_using_long() {
assert!(m.is_present("color"));
}

#[cfg(feature = "suggestions")]
#[test]
fn flag_using_long_with_literals() {
use clap::ErrorKind;

let m = App::new("flag")
.args(&[Arg::from("--rainbow 'yet another flag'").multiple_occurrences(true)])
.try_get_matches_from(vec![
"",
"--rainbow",
"--rainbow",
"--rainbow=false",
"--rainbow=true",
]);
.arg(Arg::new("--rainbow 'yet another flag'"))
.try_get_matches_from(vec!["", "--rainbow=false"]);
assert!(m.is_err(), "{:#?}", m.unwrap());
assert_eq!(m.unwrap_err().kind, ErrorKind::TooManyValues);
}
Expand Down

0 comments on commit afc9477

Please sign in to comment.