Skip to content

Commit

Permalink
Rollup merge of rust-lang#90790 - tamaroning:fix-lib-std-test, r=Mark…
Browse files Browse the repository at this point in the history
…-Simulacrum

Fix standard library test with read_link

closes rust-lang#90669
resolve this issue by comparing between Paths instead of strs
  • Loading branch information
workingjubilee authored Nov 15, 2021
2 parents bf57fec + 181716a commit 66c587e
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions library/std/src/fs/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -833,20 +833,11 @@ fn symlink_noexist() {
fn read_link() {
if cfg!(windows) {
// directory symlink
assert_eq!(
check!(fs::read_link(r"C:\Users\All Users")).to_str().unwrap(),
r"C:\ProgramData"
);
assert_eq!(check!(fs::read_link(r"C:\Users\All Users")), Path::new(r"C:\ProgramData"));
// junction
assert_eq!(
check!(fs::read_link(r"C:\Users\Default User")).to_str().unwrap(),
r"C:\Users\Default"
);
assert_eq!(check!(fs::read_link(r"C:\Users\Default User")), Path::new(r"C:\Users\Default"));
// junction with special permissions
assert_eq!(
check!(fs::read_link(r"C:\Documents and Settings\")).to_str().unwrap(),
r"C:\Users"
);
assert_eq!(check!(fs::read_link(r"C:\Documents and Settings\")), Path::new(r"C:\Users"));
}
let tmpdir = tmpdir();
let link = tmpdir.join("link");
Expand Down

0 comments on commit 66c587e

Please sign in to comment.