diff options
| author | Chris Denton <christophersdenton@gmail.com> | 2022-07-05 12:23:06 +0100 |
|---|---|---|
| committer | Chris Denton <christophersdenton@gmail.com> | 2022-07-05 12:24:01 +0100 |
| commit | 5f5bcb369730a1095d44adc9843ec80cfddea443 (patch) | |
| tree | c3cbf3bc7cdc5820128531a5b65d8fb44a2fac58 | |
| parent | 2d0650457f570ca3d0d1ff24092e71291155a8a6 (diff) | |
| download | rust-5f5bcb369730a1095d44adc9843ec80cfddea443.tar.gz rust-5f5bcb369730a1095d44adc9843ec80cfddea443.zip | |
Test if `[try_]exists` can find `hiberfil.sys`
| -rw-r--r-- | library/std/src/fs/tests.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs index d028204e5a1..d8806b6ec60 100644 --- a/library/std/src/fs/tests.rs +++ b/library/std/src/fs/tests.rs @@ -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()); } |
