diff --git a/tests/derive/doc_comments_help.rs b/tests/derive/doc_comments_help.rs index 000b98e5c6a..c35718b91f2 100644 --- a/tests/derive/doc_comments_help.rs +++ b/tests/derive/doc_comments_help.rs @@ -14,7 +14,7 @@ use crate::utils; -use clap::{ArgEnum, Parser}; +use clap::{ArgEnum, IntoApp, Parser}; #[test] fn doc_comments() { @@ -214,3 +214,28 @@ fn argenum_multiline_doc_comment() { Bar, } } + +#[test] +fn doc_comment_about_handles_both_abouts() { + /// Opts doc comment summary + #[derive(Parser, Debug)] + pub struct Opts { + #[clap(subcommand)] + pub cmd: Sub, + } + + /// Sub doc comment summary + /// + /// Sub doc comment body + #[derive(Parser, PartialEq, Eq, Debug)] + pub enum Sub { + Compress { output: String }, + } + + let app = Opts::into_app(); + assert_eq!(app.get_about(), Some("Opts doc comment summary")); + assert_eq!( + app.get_long_about(), + Some("Sub doc comment summary\n\nSub doc comment body") + ); +}