Skip to content

Commit 0c589b7

Browse files
committed
try to appease windows
1 parent 13e1bcc commit 0c589b7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

crates/ruff/tests/lint.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -2226,8 +2226,10 @@ from typing import Union;foo: Union[int, str] = 1
22262226
"#,
22272227
)?;
22282228

2229+
let testpy_canon = testpy.canonicalize()?;
2230+
22292231
insta::with_settings!({
2230-
filters => vec![(tempdir_filter(&project_dir).as_str(), "[TMP]/"),(r"(?m)\n.*\[ruff::commands::check\].*$",""),(r"(?m)^.*(\[.*\])\[DEBUG\](.*)$","$1[DEBUG]$2")]
2232+
filters => vec![(tempdir_filter(&testpy_canon).as_str(), "[TMP]/foo/test.py"),(tempdir_filter(&project_dir).as_str(), "[TMP]/"),(r"(?m)^foo\\test","foo/test"),(r"(?m)\n.*\[ruff::commands::check\].*$",""),(r"(?m)^.*(\[.*\])\[DEBUG\](.*)$","$1[DEBUG]$2")]
22312233
}, {
22322234
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
22332235
.args(STDIN_BASE_OPTIONS)
@@ -2291,8 +2293,10 @@ from typing import Union;foo: Union[int, str] = 1
22912293
"#,
22922294
)?;
22932295

2296+
let testpy_canon = testpy.canonicalize()?;
2297+
22942298
insta::with_settings!({
2295-
filters => vec![(tempdir_filter(&project_dir).as_str(), "[TMP]/"),(r"(?m)\n.*\[ruff::commands::check\].*$",""),(r"(?m)^.*(\[.*\])\[DEBUG\](.*)$","$1[DEBUG]$2")]
2299+
filters => vec![(tempdir_filter(&testpy_canon).as_str(), "[TMP]/foo/test.py"),(tempdir_filter(&project_dir).as_str(), "[TMP]/"),(r"(?m)\n.*\[ruff::commands::check\].*$",""),(r"(?m)^.*(\[.*\])\[DEBUG\](.*)$","$1[DEBUG]$2")]
22962300
}, {
22972301
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
22982302
.args(STDIN_BASE_OPTIONS)
@@ -2313,7 +2317,7 @@ from typing import Union;foo: Union[int, str] = 1
23132317
});
23142318

23152319
insta::with_settings!({
2316-
filters => vec![(tempdir_filter(&project_dir).as_str(), "[TMP]/"),(r"(?m)\n.*\[ruff::commands::check\].*$",""),(r"(?m)^.*(\[.*\])\[DEBUG\](.*)$","$1[DEBUG]$2")]
2320+
filters => vec![(tempdir_filter(&testpy_canon).as_str(), "[TMP]/foo/test.py"),(tempdir_filter(&project_dir).as_str(), "[TMP]/"),(r"(?m)\n.*\[ruff::commands::check\].*$",""),(r"(?m)^.*(\[.*\])\[DEBUG\](.*)$","$1[DEBUG]$2")]
23172321
}, {
23182322
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
23192323
.args(STDIN_BASE_OPTIONS)

0 commit comments

Comments
 (0)