Skip to content

Commit 46930bc

Browse files
committed
Move test to individual function
1 parent 2f1843c commit 46930bc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/pass-dep/libc/libc-fs-with-isolation.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ use std::{fs, thread};
77

88
fn main() {
99
test_fcntl_f_dupfd();
10+
test_readlink();
11+
test_stat();
1012
test_socketpair_setfl_getfl();
1113
test_pipe_setfl_getfl();
1214
test_setfl_getfl_threaded();
@@ -17,15 +19,17 @@ fn test_fcntl_f_dupfd() {
1719
unsafe {
1820
assert!(libc::fcntl(1, libc::F_DUPFD, 0) >= 0);
1921
}
22+
}
2023

21-
// test `readlink`
24+
fn test_readlink() {
2225
let mut buf = vec![0; "foo_link.txt".len() + 1];
2326
unsafe {
2427
assert_eq!(libc::readlink(c"foo.txt".as_ptr(), buf.as_mut_ptr(), buf.len()), -1);
2528
assert_eq!(Error::last_os_error().raw_os_error(), Some(libc::EACCES));
2629
}
30+
}
2731

28-
// test `stat`
32+
fn test_stat() {
2933
let err = fs::metadata("foo.txt").unwrap_err();
3034
assert_eq!(err.kind(), ErrorKind::PermissionDenied);
3135
// check that it is the right kind of `PermissionDenied`

0 commit comments

Comments
 (0)