test(parser): Show bad Unknown bug on flags

This commit is contained in:
Ed Page 2023-08-18 14:19:54 -05:00
parent df337de701
commit b55ebc9f7f

View file

@ -225,6 +225,10 @@ fn unknown_argument_option() {
)
.hide(true),
]);
let res = cmd.clone().try_get_matches_from(["test"]);
assert!(res.is_ok());
let res = cmd.try_get_matches_from(["test", "--cwd", ".."]);
assert!(res.is_err());
let err = res.unwrap_err();
@ -257,6 +261,10 @@ fn unknown_argument_flag() {
)
.hide(true),
]);
let res = cmd.clone().try_get_matches_from(["test"]);
assert!(res.is_err());
let res = cmd.try_get_matches_from(["test", "--ignored"]);
assert!(res.is_err());
let err = res.unwrap_err();