test(help): Show indented wrap behavior

This commit is contained in:
Ed Page 2023-04-19 10:15:38 -05:00
parent 60c8c3fc31
commit 71344749e7

View file

@ -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() {