Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: clap-rs/clap
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8ba0f6417eedf6c2c7d8351f01a89cae90fe87c1
Choose a base ref
..
head repository: clap-rs/clap
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b09fb7ba308f954c801a37ec8d1b94b880470033
Choose a head ref
Showing with 7 additions and 9 deletions.
  1. +7 −9 tests/builder/subcommands.rs
16 changes: 7 additions & 9 deletions tests/builder/subcommands.rs
Original file line number Diff line number Diff line change
@@ -569,14 +569,11 @@ For more information try help
";
utils::assert_eq(HELLO_EXPECTED, err.to_string());

let err = cmd.clone().try_get_matches_from(&["baz"]).unwrap_err();
assert!(
err.kind() == ErrorKind::InvalidSubcommand
|| err.kind() == ErrorKind::UnrecognizedSubcommand,
"err.kind()={:?}",
err.kind()
);
static BAZ_EXPECTED: &str = "\
#[cfg(feature = "suggestions")]
{
let err = cmd.clone().try_get_matches_from(&["baz"]).unwrap_err();
assert_eq!(err.kind(), ErrorKind::InvalidSubcommand);
static BAZ_EXPECTED: &str = "\
error: The subcommand 'baz' wasn't recognized
\tDid you mean 'bar'?
@@ -588,7 +585,8 @@ USAGE:
For more information try help
";
utils::assert_eq(BAZ_EXPECTED, err.to_string());
utils::assert_eq(BAZ_EXPECTED, err.to_string());
}

// Verify whatever we did to get the above to work didn't disable `--help` and `--version`.