From 53f48ddbc7f6a42c2e67f8b16f5868f483821744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= Date: Tue, 5 Mar 2024 08:11:27 +0000 Subject: [PATCH] Assert that test names cannot contain dots This is so that we can catch stray test output files, since test names without dots can form predictable patterns we can match on. --- src/tools/tidy/src/tests_revision_unpaired_stdout_stderr.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tools/tidy/src/tests_revision_unpaired_stdout_stderr.rs b/src/tools/tidy/src/tests_revision_unpaired_stdout_stderr.rs index 98b47b6ef66..a0773c85bef 100644 --- a/src/tools/tidy/src/tests_revision_unpaired_stdout_stderr.rs +++ b/src/tools/tidy/src/tests_revision_unpaired_stdout_stderr.rs @@ -88,6 +88,12 @@ pub fn check(tests_path: impl AsRef, bad: &mut bool) { continue; }; + assert!( + !test_name.contains('.'), + "test name cannot contain dots '.': `{}`", + test.display() + ); + test_info.insert(test_name.to_string(), (test, expected_revisions)); }