mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 14:52:33 +00:00
tests: add wrap_help test with significant whitepace
This adds a test for the issue #617 about keeping whitespace intact in manually aligned text.
This commit is contained in:
parent
918283d645
commit
13653042c2
1 changed files with 28 additions and 0 deletions
|
@ -241,6 +241,22 @@ FLAGS:
|
|||
(Defaults to something)
|
||||
-V, --version Prints version information";
|
||||
|
||||
static WRAPPING_NEWLINE_CHARS: &'static str = "ctest 0.1
|
||||
|
||||
USAGE:
|
||||
ctest [mode]
|
||||
|
||||
FLAGS:
|
||||
-h, --help Prints help information
|
||||
-V, --version Prints version information
|
||||
|
||||
ARGS:
|
||||
<mode> x, max, maximum 20 characters, contains
|
||||
symbols.
|
||||
l, long Copy-friendly,
|
||||
14 characters, contains symbols.
|
||||
m, med, medium Copy-friendly, 8
|
||||
characters, contains symbols.";
|
||||
|
||||
static ISSUE_688: &'static str = "ctest 0.1
|
||||
|
||||
|
@ -663,6 +679,18 @@ fn final_word_wrapping() {
|
|||
assert!(test::compare_output(app, "ctest --help", FINAL_WORD_WRAPPING, false));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn wrapping_newline_chars() {
|
||||
let app = App::new("ctest")
|
||||
.version("0.1")
|
||||
.set_term_width(60)
|
||||
.arg(Arg::with_name("mode")
|
||||
.help("x, max, maximum 20 characters, contains symbols.{n}\
|
||||
l, long Copy-friendly, 14 characters, contains symbols.{n}\
|
||||
m, med, medium Copy-friendly, 8 characters, contains symbols.{n}"));
|
||||
assert!(test::compare_output(app, "ctest --help", WRAPPING_NEWLINE_CHARS, false));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn old_newline_chars() {
|
||||
let app = App::new("ctest")
|
||||
|
|
Loading…
Reference in a new issue