From 8b051dcd14e78ba419cd26443453b3db175abb7e Mon Sep 17 00:00:00 2001 From: Mykhailo Chalyi Date: Sat, 16 May 2026 18:58:52 -0500 Subject: [PATCH] fix(testing): avoid stripping clap invalid-value stderr lines --- crates/bashkit/src/testing.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bashkit/src/testing.rs b/crates/bashkit/src/testing.rs index 7ebf9e93..19baca22 100644 --- a/crates/bashkit/src/testing.rs +++ b/crates/bashkit/src/testing.rs @@ -198,7 +198,6 @@ fn is_clap_error_chrome_line(line: &str) -> bool { if let Some(rest) = line.strip_prefix("error: ") { const CLAP_ERROR_FRAGMENTS: &[&str] = &[ "unexpected argument '", - "invalid value '", "the argument '", "unrecognized subcommand '", "the following required arguments were not provided", @@ -386,9 +385,10 @@ mod tests { } #[test] - fn strip_removes_clap_invalid_value_line() { + fn strip_keeps_clap_invalid_value_line() { let s = "error: invalid value 'Span {abc' for '--width ': not a number\n"; - assert_eq!(strip_real_shell_error_lines(s), ""); + let stripped = strip_real_shell_error_lines(s); + assert!(stripped.contains("Span {"), "stripped: {stripped:?}"); } #[test]