test(derive): Clarify doc comment
@@ -213,13 +213,25 @@ fn multiline_separates_default() {
#[test]
fn value_enum_multiline_doc_comment() {
- #[derive(ValueEnum, Clone)]
+ #[derive(Parser, Debug)]
+ struct Command {
+ x: LoremIpsum,
+ }
+
+ #[derive(ValueEnum, Clone, PartialEq, Debug)]
enum LoremIpsum {
- /// Multiline
+ /// Doc comment summary
///
- /// Doc comment
+ /// The doc comment body is ignored
Bar,
}
+
+ let help = utils::get_long_help::<Command>();
+
+ assert!(help.contains("Doc comment summary"));
+
+ // There is no long help text for possible values. The long help only contains the summary.
+ assert!(!help.contains("The doc comment body is ignored"));
}
#[test]
