Skip to content

Commit

Permalink
test(parser): Ensure we are actually testing ignore_errors
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Nov 12, 2024
1 parent ba4745d commit 3f5c05c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/builder/ignore_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use super::utils;
#[test]
fn single_short_arg_without_value() {
let cmd = Command::new("cmd").ignore_errors(true).arg(arg!(
-c --config [FILE] "Sets a custom config file"
-c --config <FILE> "Sets a custom config file"
));

let r = cmd.try_get_matches_from(vec!["cmd", "-c" /* missing: , "config file" */]);
Expand All @@ -18,7 +18,7 @@ fn single_short_arg_without_value() {
#[test]
fn single_long_arg_without_value() {
let cmd = Command::new("cmd").ignore_errors(true).arg(arg!(
-c --config [FILE] "Sets a custom config file"
-c --config <FILE> "Sets a custom config file"
));

let r = cmd.try_get_matches_from(vec!["cmd", "--config" /* missing: , "config file" */]);
Expand All @@ -33,10 +33,10 @@ fn multiple_args_and_final_arg_without_value() {
let cmd = Command::new("cmd")
.ignore_errors(true)
.arg(arg!(
-c --config [FILE] "Sets a custom config file"
-c --config <FILE> "Sets a custom config file"
))
.arg(arg!(
-x --stuff [FILE] "Sets a custom stuff file"
-x --stuff <FILE> "Sets a custom stuff file"
))
.arg(arg!(f: -f "Flag").action(ArgAction::SetTrue));

Expand All @@ -59,10 +59,10 @@ fn multiple_args_and_intermittent_arg_without_value() {
let cmd = Command::new("cmd")
.ignore_errors(true)
.arg(arg!(
-c --config[FILE] "Sets a custom config file"
-c --config <FILE> "Sets a custom config file"
))
.arg(arg!(
-x --stuff[FILE] "Sets a custom stuff file"
-x --stuff <FILE> "Sets a custom stuff file"
))
.arg(arg!(f: -f "Flag").action(ArgAction::SetTrue));

Expand Down

0 comments on commit 3f5c05c

Please sign in to comment.