about summary refs log tree commit diff
path: root/library/std/src/sys/pal/unix/fd/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/std/src/sys/pal/unix/fd/tests.rs')
-rw-r--r--library/std/src/sys/pal/unix/fd/tests.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/library/std/src/sys/pal/unix/fd/tests.rs b/library/std/src/sys/pal/unix/fd/tests.rs
new file mode 100644
index 00000000000..5d17e46786c
--- /dev/null
+++ b/library/std/src/sys/pal/unix/fd/tests.rs
@@ -0,0 +1,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());
+}