compare between Path instead of str
This commit is contained in:
parent
68ca579406
commit
181716a16c
@ -833,20 +833,11 @@ fn symlink_noexist() {
|
|||||||
fn read_link() {
|
fn read_link() {
|
||||||
if cfg!(windows) {
|
if cfg!(windows) {
|
||||||
// directory symlink
|
// directory symlink
|
||||||
assert_eq!(
|
assert_eq!(check!(fs::read_link(r"C:\Users\All Users")), Path::new(r"C:\ProgramData"));
|
||||||
check!(fs::read_link(r"C:\Users\All Users")).to_str().unwrap(),
|
|
||||||
r"C:\ProgramData"
|
|
||||||
);
|
|
||||||
// junction
|
// junction
|
||||||
assert_eq!(
|
assert_eq!(check!(fs::read_link(r"C:\Users\Default User")), Path::new(r"C:\Users\Default"));
|
||||||
check!(fs::read_link(r"C:\Users\Default User")).to_str().unwrap(),
|
|
||||||
r"C:\Users\Default"
|
|
||||||
);
|
|
||||||
// junction with special permissions
|
// junction with special permissions
|
||||||
assert_eq!(
|
assert_eq!(check!(fs::read_link(r"C:\Documents and Settings\")), Path::new(r"C:\Users"));
|
||||||
check!(fs::read_link(r"C:\Documents and Settings\")).to_str().unwrap(),
|
|
||||||
r"C:\Users"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
let tmpdir = tmpdir();
|
let tmpdir = tmpdir();
|
||||||
let link = tmpdir.join("link");
|
let link = tmpdir.join("link");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user