Skip to content

Commit

Permalink
Cleanup snapshot tests
Browse files Browse the repository at this point in the history
  • Loading branch information
snowsignal committed Jan 11, 2024
1 parent 84a1a2c commit 644aa55
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions crates/ruff_cli/tests/show_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
});
}

0 comments on commit 644aa55

Please sign in to comment.