Skip to content

test remove_dir_all #2022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e95b10ba4ac4564ed25f7eef143e3182c33b3902
c7ce69faf2a7ea16c15d922985ca27ba70da30ee
1 change: 0 additions & 1 deletion src/shims/posix/macos/dlsym.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
})
}
Expand Down
6 changes: 6 additions & 0 deletions tests/run-pass/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down