diff --git a/tests/help.rs b/tests/help.rs index 9bbb4fd35287..ff51311403e4 100644 --- a/tests/help.rs +++ b/tests/help.rs @@ -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: + 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")