Remove run anyway tip (#7782)

This commit is contained in:
Anton-4 2025-05-12 17:51:58 +02:00 committed by GitHub
parent f479d6227e
commit a27feb309a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 8 additions and 43 deletions

View file

@ -163,14 +163,8 @@ fn normalize_for_tests(original_output: &str) -> String {
.replace_all(&part_normalized, filepath_replacement)
.into_owned();
// replace tip "You can run the program anyway ..." with a placeholder
let run_anyway_replacement = "<ignored for tests>";
part_normalized = RUN_ANYWAY_REGEX
.replace_all(&part_normalized, run_anyway_replacement)
.into_owned();
// replace error summary timings
let error_summary_replacement = "$1 error and $2 warning found in <ignored for test> ms";
let error_summary_replacement = "$1 error$2 and $3 warning$4 found in <ignored for test> ms";
ERROR_SUMMARY_REGEX
.replace_all(&part_normalized, error_summary_replacement)
.into_owned()
@ -181,9 +175,7 @@ lazy_static! {
static ref TIMING_REGEX: Regex = Regex::new(r" in (\d+) ms\.").expect("Invalid regex pattern");
static ref FILEPATH_REGEX: Regex =
Regex::new(r"\[([^:]+):(\d+)\]").expect("Invalid filepath regex pattern");
static ref RUN_ANYWAY_REGEX: Regex =
Regex::new(r"the program anyway with\s+.*").expect("Invalid run anyway regex pattern");
static ref ERROR_SUMMARY_REGEX: Regex =
Regex::new(r"(\d+) error(?:s)? and (\d+) warning(?:s)? found in \d+ ms")
Regex::new(r"(\d+) error(s)? and (\d+) warning(s)? found in \d+ ms")
.expect("Invalid error summary regex pattern");
}