Skip to content

Commit

Permalink
compare between Path instead of str
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaroning committed Nov 11, 2021
1 parent 68ca579 commit 181716a
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions library/std/src/fs/tests.rs
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 181716a

Please sign in to comment.