Skip to content
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

Enhance rand to support macos #159

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions src/unix/tempdir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ mod tests {
let path = t.as_path();
assert!(path.exists());
assert!(path.is_dir());
#[cfg(not(target_os = "macos"))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we instead check that the path is in the equivalent temp_dir for mac os? Otherwise this test is not very useful.

assert!(path.starts_with(temp_dir()));
}

Expand Down Expand Up @@ -185,12 +186,14 @@ mod tests {
let path = t.as_path();
assert!(path.exists());
assert!(path.is_dir());
#[cfg(not(target_os = "macos"))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add an equivalent check here instead?

assert!(path.starts_with("/tmp/"));

let t = TempDir::new_in(Path::new("/tmp")).unwrap();
let path = t.as_path();
assert!(path.exists());
assert!(path.is_dir());
#[cfg(not(target_os = "macos"))]
assert!(path.starts_with("/tmp"));
}

Expand Down