From e0c9619c2796c9b7d784d4b8465b51c60756e05c Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 10 Jun 2024 09:15:48 -0500 Subject: [PATCH 1/2] test(parser): Snapshot num_args errors --- tests/builder/multiple_values.rs | 157 +++++++++++++++++++++++++++---- 1 file changed, 139 insertions(+), 18 deletions(-) diff --git a/tests/builder/multiple_values.rs b/tests/builder/multiple_values.rs index 4f14ea0ff1f..ba04d296123 100644 --- a/tests/builder/multiple_values.rs +++ b/tests/builder/multiple_values.rs @@ -176,7 +176,17 @@ fn option_exact_less() { .try_get_matches_from(vec!["", "-o", "val1", "-o", "val2"]); assert!(m.is_err()); - assert_eq!(m.unwrap_err().kind(), ErrorKind::WrongNumberOfValues); + let err = m.unwrap_err(); + assert_eq!(err.kind(), ErrorKind::WrongNumberOfValues); + #[cfg(feature = "error-context")] + assert_data_eq!(err.to_string(), str![[r#" +error: 3 values required for '-o