diff --git a/lib/tests/test_local_working_copy.rs b/lib/tests/test_local_working_copy.rs index 0bfe90e515..28360ed9f1 100644 --- a/lib/tests/test_local_working_copy.rs +++ b/lib/tests/test_local_working_copy.rs @@ -69,6 +69,21 @@ fn check_icase_fs(dir: &Path) -> bool { dir.join(upper_name).try_exists().unwrap() } +fn check_icase_file_symlink(dir: &Path) -> bool { + let temp_dir = tempfile::Builder::new() + .prefix("icase-") + .tempdir_in(dir) + .unwrap(); + let symlink_name = "symlink"; + std::fs::write(temp_dir.path().join("file"), "").unwrap(); + try_symlink("file", temp_dir.path().join(symlink_name)).unwrap(); + match temp_dir.path().join(symlink_name.to_ascii_uppercase()).symlink_metadata() { + Ok(_) => true, + Err(err) if err.kind() == std::io::ErrorKind::NotFound => false, + Err(err) => panic!("{err}"), + } +} + /// Returns true if the directory appears to ignore some unicode zero-width /// characters, as in HFS+. fn check_hfs_plus(dir: &Path) -> bool { @@ -1322,6 +1337,7 @@ fn test_check_out_existing_file_symlink_icase_fs(victim_exists: bool) { let repo = &test_workspace.repo; let workspace_root = test_workspace.workspace.workspace_root().to_owned(); let is_icase_fs = check_icase_fs(&workspace_root); + dbg!(check_icase_file_symlink(&workspace_root)); // XXX // Creates a symlink in working directory, and a tree that will overwrite // the symlink content.