Skip to content

Commit bc67b84

Browse files
committed
Add filter for windows specific error message
1 parent 44b8656 commit bc67b84

File tree

1 file changed

+13
-27
lines changed

1 file changed

+13
-27
lines changed

crates/ruff/tests/lint.rs

+13-27
Original file line numberDiff line numberDiff line change
@@ -620,23 +620,6 @@ extend = "ruff2.toml"
620620
"#,
621621
)?;
622622

623-
insta::with_settings!({
624-
filters => vec![(tempdir_filter(&project_dir).as_str(), "[TMP]/")]
625-
}, {
626-
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
627-
.args(["check"]).current_dir(&project_dir), @r"
628-
success: false
629-
exit_code: 2
630-
----- stdout -----
631-
632-
----- stderr -----
633-
ruff failed
634-
Cause: Failed to load extended configuration `[TMP]/ruff2.toml` (`[TMP]/ruff.toml` extends `[TMP]/ruff2.toml`)
635-
Cause: Failed to read [TMP]/ruff2.toml
636-
Cause: No such file or directory (os error 2)
637-
");
638-
});
639-
640623
fs::write(
641624
project_dir.join("ruff2.toml"),
642625
r#"
@@ -645,20 +628,23 @@ extend = "ruff3.toml"
645628
)?;
646629

647630
insta::with_settings!({
648-
filters => vec![(tempdir_filter(&project_dir).as_str(), "[TMP]/")]
631+
filters => vec![
632+
(tempdir_filter(&project_dir).as_str(), "[TMP]/"),
633+
("The system cannot find the file specified.", "No such file or directory")
634+
]
649635
}, {
650636
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
651637
.args(["check"]).current_dir(project_dir), @r"
652-
success: false
653-
exit_code: 2
654-
----- stdout -----
638+
success: false
639+
exit_code: 2
640+
----- stdout -----
655641
656-
----- stderr -----
657-
ruff failed
658-
Cause: Failed to load last configuration in chain: [TMP]/ruff.toml -> [TMP]/ruff2.toml -> [TMP]/ruff3.toml
659-
Cause: Failed to read [TMP]/ruff3.toml
660-
Cause: No such file or directory (os error 2)
661-
");
642+
----- stderr -----
643+
ruff failed
644+
Cause: Failed to load extended configuration `[TMP]/ruff3.toml` (`[TMP]/ruff.toml` extends `[TMP]/ruff2.toml` extends `[TMP]/ruff3.toml`)
645+
Cause: Failed to read [TMP]/ruff3.toml
646+
Cause: No such file or directory (os error 2)
647+
");
662648
});
663649

664650
Ok(())

0 commit comments

Comments
 (0)