From b55ebc9f7f0364c67ef48e8cbcc308b139f1a72a Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 18 Aug 2023 14:19:54 -0500 Subject: [PATCH] test(parser): Show bad Unknown bug on flags --- tests/builder/error.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/builder/error.rs b/tests/builder/error.rs index bfdf623c..bd94c6bd 100644 --- a/tests/builder/error.rs +++ b/tests/builder/error.rs @@ -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();