Skip to content

Commit 7e8922c

Browse files
committed
fix macos empty metadata test
1 parent 34d175a commit 7e8922c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/run-pass/fs.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ fn test_metadata(bytes: &[u8], path: &Path) -> Result<()> {
1818

1919
// FIXME: Implement stat64 for macos.
2020
#[cfg(not(target_os = "linux"))]
21-
fn test_metadata(_bytes: &[u8], _path: &Path) {}
21+
fn test_metadata(_bytes: &[u8], _path: &Path) -> Result<()> {
22+
Ok(())
23+
}
2224

2325
fn main() {
2426
let tmp = std::env::temp_dir();
@@ -56,5 +58,7 @@ fn main() {
5658
// Removing a non-existing file should fail with a "not found" error.
5759
assert_eq!(ErrorKind::NotFound, remove_file(&path).unwrap_err().kind());
5860
// Reading the metadata of a non-existing file should fail with a "not found" error.
59-
assert_eq!(ErrorKind::NotFound, test_metadata(bytes, &path).unwrap_err().kind());
61+
if cfg!(target_os = "linux") {
62+
assert_eq!(ErrorKind::NotFound, test_metadata(bytes, &path).unwrap_err().kind());
63+
}
6064
}

0 commit comments

Comments
 (0)