Rollup merge of #119642 - petrochenkov:winstdtest, r=ChrisDenton

library: Fix a symlink test failing on Windows
This commit is contained in:
Michael Goulet 2024-01-05 23:41:44 -05:00 committed by GitHub
commit 71610e2eb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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