Skip to content

Commit 8912a90

Browse files
haasonsaasclaude
andcommitted
test: add unit test for backslash path normalization in blast radius
Directly tests format_blast_radius_summary with Windows-style backslash paths to verify they are normalized to forward slashes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b476213 commit 8912a90

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/review/pipeline/postprocess/blast_radius.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,35 @@ mod tests {
140140
assert!(comments[0].tags.iter().any(|tag| tag == "blast-radius:3"));
141141
}
142142

143+
#[test]
144+
fn format_blast_radius_summary_normalizes_backslash_paths() {
145+
use super::format_blast_radius_summary;
146+
147+
let dependents = vec![
148+
PathBuf::from("src\\a.rs"),
149+
PathBuf::from("src\\b.rs"),
150+
PathBuf::from("src\\c.rs"),
151+
];
152+
153+
let summary = format_blast_radius_summary(&dependents);
154+
assert!(
155+
summary.contains("src/a.rs"),
156+
"expected forward slashes in summary, got: {summary}"
157+
);
158+
assert!(
159+
summary.contains("src/b.rs"),
160+
"expected forward slashes in summary, got: {summary}"
161+
);
162+
assert!(
163+
summary.contains("src/c.rs"),
164+
"expected forward slashes in summary, got: {summary}"
165+
);
166+
assert!(
167+
!summary.contains('\\'),
168+
"summary should not contain backslashes: {summary}"
169+
);
170+
}
171+
143172
#[test]
144173
fn skips_blast_radius_summary_below_threshold() {
145174
let dir = tempfile::tempdir().unwrap();

0 commit comments

Comments
 (0)