mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-14 00:00:13 +02:00
Merge branch 'v0.2.x'
This commit is contained in:
@@ -5,6 +5,7 @@ extern crate rand;
|
||||
|
||||
mod test_buf;
|
||||
mod test_buf_fill;
|
||||
mod test_buf_take;
|
||||
mod test_byte_buf;
|
||||
mod test_bytes;
|
||||
mod test_ring;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
use bytes::*;
|
||||
use std::io::{Cursor, Read};
|
||||
|
||||
#[test]
|
||||
pub fn test_take_from_buf() {
|
||||
let mut buf = Take::new(Cursor::new(b"hello world".to_vec()), 5);
|
||||
let mut res = vec![];
|
||||
|
||||
buf.read_to_end(&mut res);
|
||||
|
||||
assert_eq!(&res, b"hello");
|
||||
}
|
||||
Reference in New Issue
Block a user