windows: Return the "Not Found" error when a path is empty

This commit is contained in:
Yuki Okushi
2021-11-16 14:36:20 +09:00
parent b053550847
commit ddc1d58ca8
3 changed files with 7 additions and 4 deletions

View File

@@ -1439,4 +1439,8 @@ fn create_dir_long_paths() {
// This will fail if the path isn't converted to verbatim.
path.push("a");
fs::create_dir(&path).unwrap();
// #90940: Ensure an empty path returns the "Not Found" error.
let path = Path::new("");
assert_eq!(path.canonicalize().unwrap_err().kind(), crate::io::ErrorKind::NotFound);
}