Skip to content

Commit

Permalink
library: Fix a symlink test failing on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
petrochenkov committed Jan 5, 2024
1 parent b8c2074 commit 0d70e58
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/std/src/fs/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -936,8 +936,10 @@ fn read_link() {
}
// Check that readlink works with non-drive paths on Windows.
let link = tmpdir.join("link_unc");
check!(symlink_dir(r"\\localhost\c$\", &link));
assert_eq!(check!(fs::read_link(&link)), Path::new(r"\\localhost\c$\"));
if got_symlink_permission(&tmpdir) {
check!(symlink_dir(r"\\localhost\c$\", &link));
assert_eq!(check!(fs::read_link(&link)), Path::new(r"\\localhost\c$\"));
};
}
let link = tmpdir.join("link");
if !got_symlink_permission(&tmpdir) {
Expand Down

0 comments on commit 0d70e58

Please sign in to comment.