Vendor dependencies
Let's see how I like this workflow.
This commit is contained in:
parent
34d1830413
commit
9c435dc440
7500 changed files with 1665121 additions and 99 deletions
15
vendor/tokio/tests/io_read_exact.rs
vendored
Normal file
15
vendor/tokio/tests/io_read_exact.rs
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#![warn(rust_2018_idioms)]
|
||||
#![cfg(feature = "full")]
|
||||
|
||||
use tokio::io::AsyncReadExt;
|
||||
use tokio_test::assert_ok;
|
||||
|
||||
#[tokio::test]
|
||||
async fn read_exact() {
|
||||
let mut buf = Box::new([0; 8]);
|
||||
let mut rd: &[u8] = b"hello world";
|
||||
|
||||
let n = assert_ok!(rd.read_exact(&mut buf[..]).await);
|
||||
assert_eq!(n, 8);
|
||||
assert_eq!(buf[..], b"hello wo"[..]);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue