Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions tests/cli_integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,18 @@ fn parse_expected(result_path: &Path) -> Vec<String> {
fn normalize_cli_output(out: &str, file_name: &str) -> String {
let s = out.replace("\r\n", "\n").trim().to_string();

// If output starts with "filename:" strip it
if let Some(colon_pos) = s.find(':') {
let prefix = &s[..colon_pos];
if prefix.ends_with(file_name) {
return s[colon_pos + 1..].trim().to_string();
}
// Look for the pattern "filename: description" and extract just the description
// We need to handle paths that might contain colons (like Windows drive letters C:)
// so we search for the filename followed by a colon and space
let search_pattern = format!("{}: ", file_name);
if let Some(pos) = s.find(&search_pattern) {
return s[pos + search_pattern.len()..].trim().to_string();
}

// Fallback: try to find just "filename:" without the space
let search_pattern_no_space = format!("{}:", file_name);
if let Some(pos) = s.find(&search_pattern_no_space) {
return s[pos + search_pattern_no_space.len()..].trim().to_string();
}

s
Expand Down