Merge branch 'v0.2.x'

This commit is contained in:
Carl Lerche
2015-08-10 10:14:32 -07:00
5 changed files with 96 additions and 1 deletions
+1
View File
@@ -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;
+12
View File
@@ -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");
}