library: Fix a symlink test failing on Windows

This commit is contained in:
Vadim Petrochenkov 2024-01-06 01:40:56 +03:00
parent b8c207435c
commit 0d70e588e6

View file

@ -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) {