Skip to content

Commit aaac528

Browse files
authored
Rollup merge of #90790 - tamaroning:fix-lib-std-test, r=Mark-Simulacrum
Fix standard library test with read_link closes #90669 resolve this issue by comparing between Paths instead of strs
2 parents a0dc4ab + 181716a commit aaac528

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

library/std/src/fs/tests.rs

+3-12
Original file line numberDiff line numberDiff line change
@@ -833,20 +833,11 @@ fn symlink_noexist() {
833833
fn read_link() {
834834
if cfg!(windows) {
835835
// directory symlink
836-
assert_eq!(
837-
check!(fs::read_link(r"C:\Users\All Users")).to_str().unwrap(),
838-
r"C:\ProgramData"
839-
);
836+
assert_eq!(check!(fs::read_link(r"C:\Users\All Users")), Path::new(r"C:\ProgramData"));
840837
// junction
841-
assert_eq!(
842-
check!(fs::read_link(r"C:\Users\Default User")).to_str().unwrap(),
843-
r"C:\Users\Default"
844-
);
838+
assert_eq!(check!(fs::read_link(r"C:\Users\Default User")), Path::new(r"C:\Users\Default"));
845839
// junction with special permissions
846-
assert_eq!(
847-
check!(fs::read_link(r"C:\Documents and Settings\")).to_str().unwrap(),
848-
r"C:\Users"
849-
);
840+
assert_eq!(check!(fs::read_link(r"C:\Documents and Settings\")), Path::new(r"C:\Users"));
850841
}
851842
let tmpdir = tmpdir();
852843
let link = tmpdir.join("link");

0 commit comments

Comments
 (0)