Skip to content

Commit b795ae5

Browse files
Miguel PerezMiguel Perez
Miguel Perez
authored and
Miguel Perez
committed
Fix for issue #93283
1 parent 17dfae7 commit b795ae5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

library/std/src/fs/tests.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use crate::io::prelude::*;
22

3+
use crate::env;
34
use crate::fs::{self, File, OpenOptions};
45
use crate::io::{ErrorKind, SeekFrom};
56
use crate::path::Path;
@@ -906,7 +907,14 @@ fn read_link() {
906907
// junction
907908
assert_eq!(check!(fs::read_link(r"C:\Users\Default User")), Path::new(r"C:\Users\Default"));
908909
// junction with special permissions
909-
assert_eq!(check!(fs::read_link(r"C:\Documents and Settings\")), Path::new(r"C:\Users"));
910+
// Since not all localized windows versions contain the folder "Documents and Settings" in english,
911+
// we will briefly check, if it exists and otherwise skip the test. Except during CI we will always execute the test.
912+
if Path::new(r"C:\Documents and Settings\").exists() || env::var_os("CI").is_some() {
913+
assert_eq!(
914+
check!(fs::read_link(r"C:\Documents and Settings\")),
915+
Path::new(r"C:\Users")
916+
);
917+
}
910918
}
911919
let tmpdir = tmpdir();
912920
let link = tmpdir.join("link");

0 commit comments

Comments
 (0)