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 8b0161e commit 0e1b115Copy full SHA for 0e1b115
crates/cargo-util/src/paths.rs
@@ -931,4 +931,27 @@ mod tests {
931
assert!(symlink_path.exists());
932
assert!(dir_path.exists());
933
}
934
+
935
+ #[test]
936
+ #[cfg(windows)]
937
+ fn test_remove_symlink_file() {
938
+ use super::*;
939
+ use std::fs;
940
+ use std::os::windows::fs::symlink_file;
941
942
+ let tmpdir = tempfile::tempdir().unwrap();
943
+ let file_path = tmpdir.path().join("testfile");
944
+ let symlink_path = tmpdir.path().join("symlink");
945
946
+ fs::write(&file_path, b"test").unwrap();
947
948
+ symlink_file(&file_path, &symlink_path).expect("failed to create symlink");
949
950
+ assert!(symlink_path.exists());
951
952
+ assert!(remove_file(symlink_path.clone()).is_ok());
953
954
+ assert!(!symlink_path.exists());
955
+ assert!(file_path.exists());
956
+ }
957
0 commit comments