Skip to content

Commit db643da

Browse files
committed
tempdir: relax unit test cases to support macos
Some assumptions in unit test cases are not suitable for Darwin/macos, so relax those test cases. Signed-off-by: Liu Jiang <[email protected]>
1 parent 1484892 commit db643da

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/unix/tempdir.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ mod tests {
144144
let path = t.as_path();
145145
assert!(path.exists());
146146
assert!(path.is_dir());
147+
#[cfg(not(target_os = "macos"))]
147148
assert!(path.starts_with(temp_dir()));
148149
}
149150

@@ -185,12 +186,14 @@ mod tests {
185186
let path = t.as_path();
186187
assert!(path.exists());
187188
assert!(path.is_dir());
189+
#[cfg(not(target_os = "macos"))]
188190
assert!(path.starts_with("/tmp/"));
189191

190192
let t = TempDir::new_in(Path::new("/tmp")).unwrap();
191193
let path = t.as_path();
192194
assert!(path.exists());
193195
assert!(path.is_dir());
196+
#[cfg(not(target_os = "macos"))]
194197
assert!(path.starts_with("/tmp"));
195198
}
196199

0 commit comments

Comments
 (0)