1
0
Fork 0
firefox/third_party/rust/tokio/tests/io_chain.rs
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

16 lines
359 B
Rust

#![warn(rust_2018_idioms)]
#![cfg(feature = "full")]
use tokio::io::AsyncReadExt;
use tokio_test::assert_ok;
#[tokio::test]
async fn chain() {
let mut buf = Vec::new();
let rd1: &[u8] = b"hello ";
let rd2: &[u8] = b"world";
let mut rd = rd1.chain(rd2);
assert_ok!(rd.read_to_end(&mut buf).await);
assert_eq!(buf, b"hello world");
}