mirror of
https://github.com/clap-rs/clap
synced 2025-01-05 17:28:42 +00:00
tests: test for multiple flags in single
This commit is contained in:
parent
56ea693084
commit
999456969d
1 changed files with 13 additions and 0 deletions
13
src/lib.rs
13
src/lib.rs
|
@ -1228,5 +1228,18 @@ mod tests {
|
||||||
assert!(m.is_present("color"));
|
assert!(m.is_present("color"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn multiple_flags_in_single() {
|
||||||
|
let m = App::new("multe_flags")
|
||||||
|
.args(vec![
|
||||||
|
Arg::from_usage("-f, --flag 'some flag'"),
|
||||||
|
Arg::from_usage("-c, --color 'some other flag'"),
|
||||||
|
Arg::from_usage("-d, --debug 'another other flag'")
|
||||||
|
])
|
||||||
|
.get_matches_from(vec!["", "-fcd"]);
|
||||||
|
assert!(m.is_present("flag"));
|
||||||
|
assert!(m.is_present("color"));
|
||||||
|
assert!(m.is_present("debug"));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue