Skip to content

Commit b0c659b

Browse files
committed
test: Prevent 2 letter crate names from being merged into [HASH] in redactions
1 parent aa2f988 commit b0c659b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/cargo-test-support/src/compare.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,13 @@ fn add_regex_redactions(subs: &mut snapbox::Redactions) {
227227
regex!(r"\.cargo/target/(?<redacted>[0-9a-f]{2}/[0-9a-f]{14})"),
228228
)
229229
.unwrap();
230+
// Avoid 2 letter crate names being merged into hashes in file paths.
231+
// e.g. target/debug/build/d1/[HASH]/out
232+
subs.insert(
233+
"[HASH]",
234+
regex!(r"build/[a-z0-9]{2}/(?<redacted>[a-f0-9]{16})"),
235+
)
236+
.unwrap();
230237
subs.insert("[HASH]", regex!(r"/[a-z0-9\-_]+-(?<redacted>[0-9a-f]{16})"))
231238
.unwrap();
232239
// Match multi-part hashes like `06/b451d0d6f88b1d` used in directory paths

0 commit comments

Comments
 (0)