We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 84dc5dc commit 8b0161eCopy full SHA for 8b0161e
crates/cargo-util/src/paths.rs
@@ -908,4 +908,27 @@ mod tests {
908
);
909
}
910
911
+
912
+ #[test]
913
+ #[cfg(windows)]
914
+ fn test_remove_symlink_dir() {
915
+ use super::*;
916
+ use std::fs;
917
+ use std::os::windows::fs::symlink_dir;
918
919
+ let tmpdir = tempfile::tempdir().unwrap();
920
+ let dir_path = tmpdir.path().join("testdir");
921
+ let symlink_path = tmpdir.path().join("symlink");
922
923
+ fs::create_dir(&dir_path).unwrap();
924
925
+ symlink_dir(&dir_path, &symlink_path).expect("failed to create symlink");
926
927
+ assert!(symlink_path.exists());
928
929
+ assert!(remove_file(symlink_path.clone()).is_err());
930
931
932
+ assert!(dir_path.exists());
933
+ }
934
0 commit comments