From 65469fe85bd1ca30ee5f890e49799d6a67688006 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 12 Mar 2022 13:37:46 -0500 Subject: [PATCH] test remove_dir_all --- src/shims/posix/macos/dlsym.rs | 1 - tests/run-pass/fs.rs | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shims/posix/macos/dlsym.rs b/src/shims/posix/macos/dlsym.rs index 9994bfd53dc..d5996cc6a9e 100644 --- a/src/shims/posix/macos/dlsym.rs +++ b/src/shims/posix/macos/dlsym.rs @@ -17,7 +17,6 @@ impl Dlsym { pub fn from_str(name: &str) -> InterpResult<'static, Option> { Ok(match name { "getentropy" => Some(Dlsym::getentropy), - "openat" => None, // std has a fallback for this _ => throw_unsup_format!("unsupported macOS dlsym: {}", name), }) } diff --git a/tests/run-pass/fs.rs b/tests/run-pass/fs.rs index 7f5553e2f2c..67817e3e2c8 100644 --- a/tests/run-pass/fs.rs +++ b/tests/run-pass/fs.rs @@ -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() { -- 2.44.0