fix: fix test_resolve_relative_path_relative on windows (#7039)

This commit is contained in:
localhost
2025-09-28 21:03:57 +08:00
committed by GitHub
parent 3ca5c77d91
commit 4a3c5f85e5

View File

@@ -63,9 +63,10 @@ mod tests {
let expected = "/tmp/foo/bar";
let result = resolve_relative_path(&current_dir, rel_path);
// On Windows, the separator is '\', so normalize for comparison
// '/' is as a normal character in Windows paths
if cfg!(windows) {
assert!(result.ends_with("foo\\bar"));
assert!(result.contains("\\tmp\\") || result.contains("C:\\tmp\\"));
assert!(result.ends_with("foo/bar"));
assert!(result.contains("/tmp\\"));
} else {
assert_eq!(result, expected);
}