diff options
| author | Michael Goulet <michael@errs.io> | 2024-01-05 23:41:44 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-05 23:41:44 -0500 |
| commit | 71610e2eb66dbcda5342700c8bfad12f89756054 (patch) | |
| tree | 07bb6497dae3d4dd04a5f2b297ec1596462d4656 /library/std/src | |
| parent | a98993c2ea664ded3fcc53e6e1587af498f17648 (diff) | |
| parent | 0d70e588e6624db9ce001d32e9ce1148cfde8085 (diff) | |
| download | rust-71610e2eb66dbcda5342700c8bfad12f89756054.tar.gz rust-71610e2eb66dbcda5342700c8bfad12f89756054.zip | |
Rollup merge of #119642 - petrochenkov:winstdtest, r=ChrisDenton
library: Fix a symlink test failing on Windows
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/fs/tests.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs index 12afdef2669..5917bf8df02 100644 --- a/library/std/src/fs/tests.rs +++ b/library/std/src/fs/tests.rs @@ -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) { |
