]> git.lizzy.rs Git - rust.git/commitdiff
Add a testcase.
authorDan Gohman <dev@sunfishcode.online>
Sun, 20 Mar 2022 22:54:03 +0000 (15:54 -0700)
committerDan Gohman <dev@sunfishcode.online>
Sun, 20 Mar 2022 22:56:25 +0000 (15:56 -0700)
library/std/src/fs/tests.rs

index 6d67c396c623a759ba323ce421f22c01577d894e..3fa731c95298347931ebaef3fd6202100dfd9823 100644 (file)
@@ -1359,6 +1359,12 @@ fn read_dir_not_found() {
     assert_eq!(res.err().unwrap().kind(), ErrorKind::NotFound);
 }
 
+#[test]
+fn file_open_not_found() {
+    let res = File::open("/path/that/does/not/exist");
+    assert_eq!(res.err().unwrap().kind(), ErrorKind::NotFound);
+}
+
 #[test]
 fn create_dir_all_with_junctions() {
     let tmpdir = tmpdir();