mirror of
https://github.com/clap-rs/clap
synced 2024-12-12 22:02:35 +00:00
test(parser): Show bad Unknown bug on flags
This commit is contained in:
parent
df337de701
commit
b55ebc9f7f
1 changed files with 8 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue