mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 23:04:23 +00:00
test: Added regression tests for Issue 897
This commit is contained in:
parent
b4b4ab629d
commit
24d5fb3202
1 changed files with 46 additions and 1 deletions
|
@ -1444,3 +1444,48 @@ fn multiple_custom_help_headers() {
|
|||
false
|
||||
));
|
||||
}
|
||||
|
||||
static ISSUE_897: &'static str = "ctest-foo 0.1
|
||||
Long about foo
|
||||
|
||||
USAGE:
|
||||
ctest foo
|
||||
|
||||
FLAGS:
|
||||
-h, --help
|
||||
Prints help information
|
||||
|
||||
-V, --version
|
||||
Prints version information";
|
||||
|
||||
#[test]
|
||||
fn show_long_about_issue_897() {
|
||||
let app = App::new("ctest")
|
||||
.version("0.1")
|
||||
.subcommand(SubCommand::with_name("foo")
|
||||
.version("0.1")
|
||||
.about("About foo")
|
||||
.long_about("Long about foo"));
|
||||
assert!(test::compare_output(app, "ctest foo --help", ISSUE_897, false));
|
||||
}
|
||||
|
||||
static ISSUE_897_SHORT: &'static str = "ctest-foo 0.1
|
||||
Long about foo
|
||||
|
||||
USAGE:
|
||||
ctest foo
|
||||
|
||||
FLAGS:
|
||||
-h, --help Prints help information
|
||||
-V, --version Prints version information";
|
||||
|
||||
#[test]
|
||||
fn show_short_about_issue_897() {
|
||||
let app = App::new("ctest")
|
||||
.version("0.1")
|
||||
.subcommand(SubCommand::with_name("foo")
|
||||
.version("0.1")
|
||||
.about("About foo")
|
||||
.long_about("Long about foo"));
|
||||
assert!(test::compare_output(app, "ctest foo -h", ISSUE_897_SHORT, false));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue