From ba762998180d4a886a868238b67ef9d56b99defa Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Thu, 7 Nov 2024 13:03:20 +0900 Subject: [PATCH] tests: use platform path separator in symlink content Appears that this was the reason why we got the error "The filename, directory name, or volume label syntax is incorrect" on Windows CI. --- lib/tests/test_local_working_copy.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/tests/test_local_working_copy.rs b/lib/tests/test_local_working_copy.rs index ff9ff14254..9ecddd711b 100644 --- a/lib/tests/test_local_working_copy.rs +++ b/lib/tests/test_local_working_copy.rs @@ -17,6 +17,7 @@ use std::os::unix::fs::PermissionsExt; #[cfg(unix)] use std::os::unix::net::UnixListener; use std::path::Path; +use std::path::PathBuf; use std::sync::Arc; use assert_matches::assert_matches; @@ -1324,7 +1325,11 @@ fn test_check_out_existing_file_symlink_icase_fs(victim_exists: bool) { // Creates a symlink in working directory, and a tree that will overwrite // the symlink content. - try_symlink("../pwned", workspace_root.join("parent")).unwrap(); + try_symlink( + PathBuf::from_iter(["..", "pwned"]), + workspace_root.join("parent"), + ) + .unwrap(); let victim_file_path = workspace_root.parent().unwrap().join("pwned"); if victim_exists { std::fs::write(&victim_file_path, "old").unwrap();