From 14a8a6ec187fb989a070b11db6cfa6f226c246a0 Mon Sep 17 00:00:00 2001 From: Jane Lewis Date: Thu, 11 Jan 2024 15:16:13 -0800 Subject: [PATCH] Cleanup snapshot tests --- crates/ruff_cli/tests/show_settings.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/crates/ruff_cli/tests/show_settings.rs b/crates/ruff_cli/tests/show_settings.rs index 9de63e12351b5..e2016e378542b 100644 --- a/crates/ruff_cli/tests/show_settings.rs +++ b/crates/ruff_cli/tests/show_settings.rs @@ -13,16 +13,17 @@ const TEST_FILTERS: &[(&str, &str)] = &[ ]; #[cfg(target_os = "windows")] const TEST_FILTERS: &[(&str, &str)] = &[ - (r".*\\resources\\test\\fixtures\\", "[BASEPATH]\\"), - (r#"[^\*"]*\\pyproject.toml"#, "\"[BASEPATH]\\pyproject.toml"), - (r#"".*\\crates"#, "\"[BASEPATH]\\crates"), - (r#"".*\\\.ruff_cache"#, "\"[BASEPATH]\\.ruff_cache"), + (r#""[^\*"]*\\pyproject.toml"#, "\"[BASEPATH]/pyproject.toml"), + (r#"".*\\crates"#, "\"[BASEPATH]/crates"), + (r#"".*\\\.ruff_cache"#, "\"[BASEPATH]/.ruff_cache"), (r#"".*\\ruff""#, "\"[BASEPATH]\""), - (r"\\", "/"), + (r#"\\+(\w\w|\s|")"#, "/$1"), ]; #[test] fn display_default_settings() { - insta::with_settings!({ filters => TEST_FILTERS.to_vec() }, { assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) - .args(["check", "--show-settings", "unformatted.py"]).current_dir(Path::new("./resources/test/fixtures"))) } ); + insta::with_settings!({ filters => TEST_FILTERS.to_vec() }, { + assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) + .args(["check", "--show-settings", "unformatted.py"]).current_dir(Path::new("./resources/test/fixtures"))); + }); }