From 811207cb19345d58794b074102effc676d5acb24 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Tue, 3 Sep 2024 14:38:58 -0400 Subject: [PATCH] uv/tests: remove double-escaping The key change here is to use raw strings so that we don't need to double-escape things like `\d`. And in particular, we rely on the fact that `"\n"` and `r"\n"` are precisely equivalent when fed to `Regex::new` in the `regex` crate. --- crates/uv/tests/common/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/uv/tests/common/mod.rs b/crates/uv/tests/common/mod.rs index 195fb5dbf..930c63249 100644 --- a/crates/uv/tests/common/mod.rs +++ b/crates/uv/tests/common/mod.rs @@ -1089,10 +1089,10 @@ pub fn run_and_format_with_status>( if let Some(windows_filters) = windows_filters { // The optional leading +/-/~ is for install logs, the optional next line is for lockfiles let windows_only_deps = [ - ("( [-+~] )?colorama==\\d+(\\.[\\d+])+( \\\\\n --hash=.*)?\n( # via .*\n)?"), - ("( [-+~] )?colorama==\\d+(\\.[\\d+])+(\\s+# via .*)?\n"), - ("( [-+~] )?tzdata==\\d+(\\.[\\d+])+( \\\\\n --hash=.*)?\n( # via .*\n)?"), - ("( [-+~] )?tzdata==\\d+(\\.[\\d+])+(\\s+# via .*)?\n"), + (r"( [-+~] )?colorama==\d+(\.[\d+])+( \n --hash=.*)?\n( # via .*\n)?"), + (r"( [-+~] )?colorama==\d+(\.[\d+])+(\s+# via .*)?\n"), + (r"( [-+~] )?tzdata==\d+(\.[\d+])+( \n --hash=.*)?\n( # via .*\n)?"), + (r"( [-+~] )?tzdata==\d+(\.[\d+])+(\s+# via .*)?\n"), ]; let mut removed_packages = 0; for windows_only_dep in windows_only_deps {