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