about summary refs log tree commit diff
path: root/library/std/src/fs
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2024-01-06 01:40:56 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2024-01-06 01:40:56 +0300
commit0d70e588e6624db9ce001d32e9ce1148cfde8085 (patch)
treeeebe90137912b20c8988b053d099adfeea6e432a /library/std/src/fs
parentb8c207435c85955d0c0806240d5491f5ccd1def5 (diff)
downloadrust-0d70e588e6624db9ce001d32e9ce1148cfde8085.tar.gz
rust-0d70e588e6624db9ce001d32e9ce1148cfde8085.zip
library: Fix a symlink test failing on Windows
Diffstat (limited to 'library/std/src/fs')
-rw-r--r--library/std/src/fs/tests.rs6
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) {