diff --git a/tests/derive/flatten.rs b/tests/derive/flatten.rs index bdd03873..3242a6b6 100644 --- a/tests/derive/flatten.rs +++ b/tests/derive/flatten.rs @@ -255,3 +255,22 @@ fn docstrings_ordering_with_multiple_clap_partial() { assert!(short_help.contains("This is the docstring for Flattened")); } + +#[test] +#[should_panic = "#[arg(flatten)]`ed field type implements `Args::group_id"] +fn flatten_skipped_group() { + #[derive(clap::Parser, Debug)] + struct Cli { + #[clap(flatten)] + args: Option, + } + + #[derive(clap::Args, Debug)] + #[group(skip)] + struct Args { + #[clap(short)] + param: bool, + } + + Cli::try_parse_from(["test"]).unwrap(); +}