mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 14:22:34 +00:00
tests: adds tests for passing assertions with new Arg::last setting
This commit is contained in:
parent
9a3bc98e9b
commit
b049cecccc
1 changed files with 10 additions and 0 deletions
|
@ -234,3 +234,13 @@ fn last_positional_no_double_dash() {
|
|||
assert!(r.is_err());
|
||||
assert_eq!(r.unwrap_err().kind, ErrorKind::UnknownArgument);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn last_positional_second_to_last_mult() {
|
||||
let r = App::new("test")
|
||||
.arg_from_usage("<TARGET> 'some target'")
|
||||
.arg_from_usage("[CORPUS]... 'some corpus'")
|
||||
.arg(Arg::from_usage("[ARGS]... 'some file'").last(true))
|
||||
.get_matches_from_safe(vec!["test", "tgt", "crp1", "crp2", "--", "arg"]);
|
||||
assert!(r.is_ok(), "{:?}", r.unwrap_err().kind);
|
||||
}
|
Loading…
Reference in a new issue