From c7876a26fa9cdfadcb8a293f06090547a9f15380 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 4 May 2022 08:11:51 -0500 Subject: [PATCH] test(multicall): Conditionalize suggestion-related case This impacts the error code (#3676) and the error body and without suggestions, its redundant. --- tests/builder/subcommands.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/builder/subcommands.rs b/tests/builder/subcommands.rs index 836102eeb2de..c3114238558c 100644 --- a/tests/builder/subcommands.rs +++ b/tests/builder/subcommands.rs @@ -572,9 +572,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_eq!(err.kind(), ErrorKind::InvalidSubcommand); - 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'? @@ -586,7 +588,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`.