Skip to content

Commit

Permalink
tests: use platform path separator in symlink content
Browse files Browse the repository at this point in the history
Appears that this was the reason why we got the error "The filename, directory
name, or volume label syntax is incorrect" on Windows CI.
  • Loading branch information
yuja committed Nov 7, 2024
1 parent adef815 commit ba76299
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/tests/test_local_working_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit ba76299

Please sign in to comment.