Skip to content

Commit

Permalink
Test if [try_]exists can find hiberfil.sys
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisDenton committed Jul 5, 2022
1 parent 2d06504 commit 5f5bcb3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/std/src/fs/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1541,8 +1541,10 @@ fn read_large_dir() {
#[test]
#[cfg(windows)]
fn hiberfil_sys() {
let hiberfil = r"C:\hiberfil.sys";
let hiberfil = Path::new(r"C:\hiberfil.sys");

fs::metadata(hiberfil).unwrap();
assert_eq!(true, hiberfil.try_exists().unwrap());
fs::symlink_metadata(hiberfil).unwrap();
fs::metadata(hiberfil).unwrap();
assert_eq!(true, hiberfil.exists());
}

0 comments on commit 5f5bcb3

Please sign in to comment.