Skip to content

Commit

Permalink
tests: show how final word is not always wrapped
Browse files Browse the repository at this point in the history
This is clap-rs#828.
  • Loading branch information
mgeisler committed Jan 30, 2017
1 parent 84d8c54 commit 563a539
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,19 @@ OPTIONS:
-c, --cafe <FILE> A coffeehouse, coffee shop, or café.
-p, --pos <VAL> Some vals [values: fast, slow]";

static FINAL_WORD_WRAPPING: &'static str = "ctest 0.1
USAGE:
ctest
FLAGS:
-h, --help
Prints help
information
-V, --version
Prints
version information";

static OLD_NEWLINE_CHARS: &'static str = "ctest 0.1
USAGE:
Expand Down Expand Up @@ -409,6 +422,12 @@ fn issue_626_variable_panic() {
}
}

#[test]
fn final_word_wrapping() {
let app = App::new("ctest").version("0.1").set_term_width(24);
assert!(test::compare_output(app, "ctest --help", FINAL_WORD_WRAPPING, false));
}

#[test]
fn old_newline_chars() {
let app = App::new("ctest")
Expand Down

0 comments on commit 563a539

Please sign in to comment.