test: Added regression tests for Issue 897

This commit is contained in:
Kevin K 2018-06-12 10:01:42 -04:00
parent b4b4ab629d
commit 24d5fb3202

View file

@ -1443,4 +1443,49 @@ fn multiple_custom_help_headers() {
MULTIPLE_CUSTOM_HELP_SECTIONS,
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));
}