From b049cecccc11693147bd0b2906df00b7eb5852de Mon Sep 17 00:00:00 2001 From: Kevin K Date: Sun, 12 Mar 2017 12:45:59 -0400 Subject: [PATCH] tests: adds tests for passing assertions with new Arg::last setting --- tests/positionals.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/positionals.rs b/tests/positionals.rs index cf7cf468..3a4ecac9 100644 --- a/tests/positionals.rs +++ b/tests/positionals.rs @@ -233,4 +233,14 @@ fn last_positional_no_double_dash() { .get_matches_from_safe(vec!["test", "tgt", "crp", "arg"]); 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(" '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); } \ No newline at end of file