From 328bc5fdfc873974da8c13da750480a0170296d3 Mon Sep 17 00:00:00 2001 From: eth3lbert Date: Sat, 22 Jun 2024 03:08:26 +0800 Subject: [PATCH] test: Add auto-redaction for not found error --- crates/cargo-test-support/src/compare.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/cargo-test-support/src/compare.rs b/crates/cargo-test-support/src/compare.rs index 620cf5a334ee..5ca56201635e 100644 --- a/crates/cargo-test-support/src/compare.rs +++ b/crates/cargo-test-support/src/compare.rs @@ -201,6 +201,18 @@ static MIN_LITERAL_REDACTIONS: &[(&str, &str)] = &[ ("[EXE]", std::env::consts::EXE_SUFFIX), ("[BROKEN_PIPE]", "Broken pipe (os error 32)"), ("[BROKEN_PIPE]", "The pipe is being closed. (os error 232)"), + // Unix message for an entity was not found + ("[NOT_FOUND]", "No such file or directory (os error 2)"), + // Windows message for an entity was not found + ( + "[NOT_FOUND]", + "The system cannot find the file specified. (os error 2)", + ), + ( + "[NOT_FOUND]", + "The system cannot find the path specified. (os error 3)", + ), + ("[NOT_FOUND]", "program not found"), // Unix message for exit status ("[EXIT_STATUS]", "exit status"), // Windows message for exit status