tests: adds a test where a non-existing arg is added to a group to ensure a failed debug assertion
@@ -41,6 +41,18 @@ fn required_group_missing_arg() {
assert_eq!(err.kind, ErrorKind::MissingRequiredArgument);
}
+#[test]
+#[should_panic]
+fn non_existing_arg() {
+ let _ = App::new("group")
+ .args_from_usage("-f, --flag 'some flag'
+ -c, --color 'some other flag'")
+ .group(ArgGroup::with_name("req")
+ .args(&["flg", "color"])
+ .required(true))
+ .get_matches_from_safe(vec![""]);
+}
+
#[test]
fn group_single_value() {
let m = App::new("group")
