fix: handle Windows paths in pre-commit tests (#2974)

Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
Henry Guo
2026-05-15 22:04:51 +08:00
committed by GitHub
parent 738fb86611
commit bca8b08c2b
15 changed files with 134 additions and 46 deletions
+4 -2
View File
@@ -749,6 +749,7 @@ fn validate_local_cross_device_mounts(local_paths: &[String]) -> Result<()> {
#[cfg(test)]
mod test {
use path_absolutize::Absolutize;
use rustfs_utils::must_get_local_ips;
use super::*;
@@ -1452,9 +1453,10 @@ mod test {
}
fn must_file_path(s: impl AsRef<Path>) -> url::Url {
let url = url::Url::from_file_path(s.as_ref());
let path = s.as_ref().absolutize().expect("absolute test path");
let url = url::Url::from_file_path(&path);
assert!(url.is_ok(), "failed to convert path to URL: {}", s.as_ref().display());
assert!(url.is_ok(), "failed to convert path to URL: {}", path.display());
url.unwrap()
}