Make fs::canonicalize work on directories on Windows
Signed-off-by: Peter Atashian <retep998@gmail.com>
This commit is contained in:
parent
edeb4f1c86
commit
6b9b2ee878
2 changed files with 11 additions and 0 deletions
|
@ -2083,6 +2083,15 @@ mod tests {
|
|||
check!(fs::create_dir_all(&path.join("a/")));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn canonicalize_works_simple() {
|
||||
let tmpdir = tmpdir();
|
||||
let tmpdir = fs::canonicalize(tmpdir.path()).unwrap();
|
||||
let file = tmpdir.join("test");
|
||||
File::create(&file).unwrap();
|
||||
assert_eq!(fs::canonicalize(&file).unwrap(), file);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(windows))]
|
||||
fn realpath_works() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue