Skip to content

Commit 3203c74

Browse files
author
m1guelperez
committed
Updated fix
1 parent 2497243 commit 3203c74

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

library/std/src/fs/tests.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -913,19 +913,13 @@ fn read_link() {
913913
// junction
914914
assert_eq!(check!(fs::read_link(r"C:\Users\Default User")), Path::new(r"C:\Users\Default"));
915915
// junction with special permissions
916-
match env::var(environment_variable) {
917-
Ok(_var) => assert_eq!(
916+
// Since not all localized windows versions contain the folder "Documents and settings" in english,
917+
// we will briefly check, if it exists and otherwise skip the test. Except durin CI we will always execute the test.
918+
if Path::new(r"C:\Documents and settings\").exists() || env::var_os("CI").is_some() {
919+
assert_eq!(
918920
check!(fs::read_link(r"C:\Documents and settings\")),
919921
Path::new(r"C:\Users")
920-
),
921-
Err(_e) => {
922-
if Path::new(r"C:\Documents and settings\").exists() {
923-
assert_eq!(
924-
check!(fs::read_link(r"C:\Documents and settings\")),
925-
Path::new(r"C:\Users")
926-
)
927-
}
928-
}
922+
);
929923
}
930924
}
931925
let tmpdir = tmpdir();

0 commit comments

Comments
 (0)