Skip to content

Commit ad48a79

Browse files
Rollup merge of rust-lang#119642 - petrochenkov:winstdtest, r=ChrisDenton
library: Fix a symlink test failing on Windows
2 parents f17ebb1 + 0d70e58 commit ad48a79

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

library/std/src/fs/tests.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -936,8 +936,10 @@ fn read_link() {
936936
}
937937
// Check that readlink works with non-drive paths on Windows.
938938
let link = tmpdir.join("link_unc");
939-
check!(symlink_dir(r"\\localhost\c$\", &link));
940-
assert_eq!(check!(fs::read_link(&link)), Path::new(r"\\localhost\c$\"));
939+
if got_symlink_permission(&tmpdir) {
940+
check!(symlink_dir(r"\\localhost\c$\", &link));
941+
assert_eq!(check!(fs::read_link(&link)), Path::new(r"\\localhost\c$\"));
942+
};
941943
}
942944
let link = tmpdir.join("link");
943945
if !got_symlink_permission(&tmpdir) {

0 commit comments

Comments
 (0)