Skip to content

Commit

Permalink
test(parser): Show bad Unknown bug on flags
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Aug 18, 2023
1 parent df337de commit b55ebc9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/builder/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit b55ebc9

Please sign in to comment.