Skip to content

Commit

Permalink
Add filter for windows specific error message
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Feb 17, 2025
1 parent 44b8656 commit bc67b84
Showing 1 changed file with 13 additions and 27 deletions.
40 changes: 13 additions & 27 deletions crates/ruff/tests/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,23 +620,6 @@ extend = "ruff2.toml"
"#,
)?;

insta::with_settings!({
filters => vec![(tempdir_filter(&project_dir).as_str(), "[TMP]/")]
}, {
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(["check"]).current_dir(&project_dir), @r"
success: false
exit_code: 2
----- stdout -----
----- stderr -----
ruff failed
Cause: Failed to load extended configuration `[TMP]/ruff2.toml` (`[TMP]/ruff.toml` extends `[TMP]/ruff2.toml`)
Cause: Failed to read [TMP]/ruff2.toml
Cause: No such file or directory (os error 2)
");
});

fs::write(
project_dir.join("ruff2.toml"),
r#"
Expand All @@ -645,20 +628,23 @@ extend = "ruff3.toml"
)?;

insta::with_settings!({
filters => vec![(tempdir_filter(&project_dir).as_str(), "[TMP]/")]
filters => vec![
(tempdir_filter(&project_dir).as_str(), "[TMP]/"),
("The system cannot find the file specified.", "No such file or directory")
]
}, {
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.args(["check"]).current_dir(project_dir), @r"
success: false
exit_code: 2
----- stdout -----
success: false
exit_code: 2
----- stdout -----
----- stderr -----
ruff failed
Cause: Failed to load last configuration in chain: [TMP]/ruff.toml -> [TMP]/ruff2.toml -> [TMP]/ruff3.toml
Cause: Failed to read [TMP]/ruff3.toml
Cause: No such file or directory (os error 2)
");
----- stderr -----
ruff failed
Cause: Failed to load extended configuration `[TMP]/ruff3.toml` (`[TMP]/ruff.toml` extends `[TMP]/ruff2.toml` extends `[TMP]/ruff3.toml`)
Cause: Failed to read [TMP]/ruff3.toml
Cause: No such file or directory (os error 2)
");
});

Ok(())
Expand Down

0 comments on commit bc67b84

Please sign in to comment.