mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 14:22:34 +00:00
test(help): Show indented wrap behavior
This commit is contained in:
parent
60c8c3fc31
commit
71344749e7
1 changed files with 29 additions and 0 deletions
|
@ -799,6 +799,35 @@ Options:
|
|||
utils::assert_output(cmd, "ctest --help", WRAPPING_NEWLINE_CHARS, false);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "wrap_help")]
|
||||
fn wrapped_indentation() {
|
||||
static HELP: &str = "\
|
||||
Usage: ctest [mode]
|
||||
|
||||
Arguments:
|
||||
[mode] Some values:
|
||||
- l, long Copy-friendly, 14
|
||||
characters, contains symbols.
|
||||
- m, med, medium Copy-friendly, 8 characters,
|
||||
contains symbols.
|
||||
|
||||
Options:
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
let cmd = Command::new("ctest")
|
||||
.version("0.1")
|
||||
.term_width(60)
|
||||
.arg(Arg::new("mode").help(
|
||||
"Some values:
|
||||
- l, long Copy-friendly, 14 characters, contains symbols.
|
||||
- m, med, medium Copy-friendly, 8 characters, contains symbols.",
|
||||
));
|
||||
utils::assert_output(cmd, "ctest --help", HELP, false);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "wrap_help")]
|
||||
fn wrapping_newline_variables() {
|
||||
|
|
Loading…
Reference in a new issue