Skip to content

Commit

Permalink
test: Added regression tests for Issue 897
Browse files Browse the repository at this point in the history
  • Loading branch information
savish committed Jun 9, 2018
1 parent 6acc8b6 commit 1281b81
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions tests/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1166,10 +1166,10 @@ USAGE:
ctest foo
FLAGS:
-h, --help
-h, --help
Prints help information
-V, --version
-V, --version
Prints version information";

#[test]
Expand All @@ -1182,3 +1182,24 @@ fn show_long_about_issue_897() {
.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));
}

0 comments on commit 1281b81

Please sign in to comment.