test remove_dir_all

This commit is contained in:
Ralf Jung 2022-03-12 13:37:46 -05:00
parent 57786678d4
commit 65469fe85b
2 changed files with 6 additions and 1 deletions

View 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),
})
}

View 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() {