From 1f5f7021e56ad1aec59862defe8064d103d53ff6 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Sat, 21 Sep 2024 20:47:07 -0500 Subject: [PATCH] fix(test):; Allow '0 files' to not be redacted --- crates/cargo-test-support/src/compare.rs | 2 +- tests/testsuite/clean.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/cargo-test-support/src/compare.rs b/crates/cargo-test-support/src/compare.rs index e822bb382..f1ab30501 100644 --- a/crates/cargo-test-support/src/compare.rs +++ b/crates/cargo-test-support/src/compare.rs @@ -208,7 +208,7 @@ fn add_regex_redactions(subs: &mut snapbox::Redactions) { .unwrap(); subs.insert( "[FILE_NUM]", - regex!(r"\[(REMOVED|SUMMARY)\] (?[0-9]+) files"), + regex!(r"\[(REMOVED|SUMMARY)\] (?[1-9][0-9]*) files"), ) .unwrap(); subs.insert( diff --git a/tests/testsuite/clean.rs b/tests/testsuite/clean.rs index 4b226ad89..7caf4f35e 100644 --- a/tests/testsuite/clean.rs +++ b/tests/testsuite/clean.rs @@ -849,7 +849,7 @@ fn clean_dry_run() { p.cargo("clean --dry-run") .with_stdout_data("") .with_stderr_data(str![[r#" -[SUMMARY] [FILE_NUM] files +[SUMMARY] 0 files [WARNING] no files deleted due to --dry-run "#]])