Skip to content

Commit

Permalink
tempdir: relax unit test cases to support macos
Browse files Browse the repository at this point in the history
Some assumptions in unit test cases are not suitable for Darwin/macos,
so relax those test cases.

Signed-off-by: Liu Jiang <[email protected]>
  • Loading branch information
jiangliu committed Mar 18, 2022
1 parent 1484892 commit db643da
Showing 1 changed file with 3 additions and 0 deletions.
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"))]
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"))]
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

0 comments on commit db643da

Please sign in to comment.