diff --git a/tests/help.rs b/tests/help.rs index e2c8020a..73b695cc 100644 --- a/tests/help.rs +++ b/tests/help.rs @@ -1,3 +1,4 @@ +#[macro_use] extern crate clap; extern crate regex; @@ -400,6 +401,19 @@ ARGS: The path of the binary to be profiled. If empty, Cargo.toml is searched for a binary. ... Any arguments you wish to pass to the binary being profiled."; +static LAST_ARG_REQ_MULT: &'static str = "example 1.0 + +USAGE: + example ... [--] ... + +FLAGS: + -h, --help Prints help information + -V, --version Prints version information + +ARGS: + ... First + ... Second"; + #[test] fn help_short() { let m = App::new("test") @@ -450,6 +464,16 @@ fn help_subcommand() { assert!(m.is_err()); assert_eq!(m.unwrap_err().kind, ErrorKind::HelpDisplayed); } + +#[test] +fn req_last_arg_usage() { + let app = clap_app!(example => + (version: "1.0") + (@arg FIRST: ... * "First") + (@arg SECOND: ... * +last "Second") + ); + assert!(test::compare_output(app, "example --help", LAST_ARG_REQ_MULT, false)); +} #[test] fn args_with_last_usage() {