Skip to content

Commit 0e59b6f

Browse files
committed
Merge fs and fs_libc tests
1 parent 8b89c7e commit 0e59b6f

File tree

4 files changed

+11
-20
lines changed

4 files changed

+11
-20
lines changed

tests/run-pass/fs.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ fn main() {
2525
test_errors();
2626
test_rename();
2727
test_directory();
28+
test_dup_stdout_stderr();
2829
}
2930

3031
fn tmp() -> PathBuf {
@@ -335,3 +336,13 @@ fn test_directory() {
335336
// Reading the metadata of a non-existent directory should fail with a "not found" error.
336337
assert_eq!(ErrorKind::NotFound, check_metadata(&[], &dir_path).unwrap_err().kind());
337338
}
339+
340+
fn test_dup_stdout_stderr() {
341+
let bytes = b"hello dup fd\n";
342+
unsafe {
343+
let new_stdout = libc::fcntl(1, libc::F_DUPFD, 0);
344+
let new_stderr = libc::fcntl(2, libc::F_DUPFD, 0);
345+
libc::write(new_stdout, bytes.as_ptr() as *const libc::c_void, bytes.len());
346+
libc::write(new_stderr, bytes.as_ptr() as *const libc::c_void, bytes.len());
347+
}
348+
}
File renamed without changes.
File renamed without changes.

tests/run-pass/fs_libc.rs

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)