summaryrefslogtreecommitdiffstats
path: root/library/std/src/sys/unix/fd/tests.rs
blob: 5d17e46786c79d05972ab5a2827a8598496ed449 (plain)
1
2
3
4
5
6
7
8
9
10
use super::{FileDesc, IoSlice};
use crate::os::unix::io::FromRawFd;
use core::mem::ManuallyDrop;

#[test]
fn limit_vector_count() {
    let stdout = ManuallyDrop::new(unsafe { FileDesc::from_raw_fd(1) });
    let bufs = (0..1500).map(|_| IoSlice::new(&[])).collect::<Vec<_>>();
    assert!(stdout.write_vectored(&bufs).is_ok());
}