]> git.lizzy.rs Git - rust.git/commitdiff
test remove_dir_all
authorRalf Jung <post@ralfj.de>
Sat, 12 Mar 2022 18:37:46 +0000 (13:37 -0500)
committerRalf Jung <post@ralfj.de>
Sun, 20 Mar 2022 14:36:27 +0000 (10:36 -0400)
src/shims/posix/macos/dlsym.rs
tests/run-pass/fs.rs

index 9994bfd53dc5deb4b19fffbc2933aae6741fac7a..d5996cc6a9ed16f12c343e25be2c824c2ab0140b 100644 (file)
@@ -17,7 +17,6 @@ impl Dlsym {
     pub fn from_str(name: &str) -> InterpResult<'static, Option<Dlsym>> {
         Ok(match name {
             "getentropy" => Some(Dlsym::getentropy),
-            "openat" => None, // std has a fallback for this
             _ => throw_unsup_format!("unsupported macOS dlsym: {}", name),
         })
     }
index 7f5553e2f2cb90e3bea716a6c46d2df08a147c7f..67817e3e2c856c492489f9e2f19a96c0a12393ec 100644 (file)
@@ -395,6 +395,12 @@ fn test_directory() {
     remove_dir(&dir_path).unwrap();
     // Reading the metadata of a non-existent directory should fail with a "not found" error.
     assert_eq!(ErrorKind::NotFound, check_metadata(&[], &dir_path).unwrap_err().kind());
+
+    // To test remove_dir_all, re-create the directory with a file and a directory in it.
+    create_dir(&dir_path).unwrap();
+    drop(File::create(&path_1).unwrap());
+    create_dir(&path_2).unwrap();
+    remove_dir_all(&dir_path).unwrap();
 }
 
 fn test_dup_stdout_stderr() {