1 #![warn(rust_2018_idioms)]
2 
3 use bytes::buf::Buf;
4 
5 #[test]
long_take()6 fn long_take() {
7     // Tests that get a take with a size greater than the buffer length will not
8     // overrun the buffer. Regression test for #138.
9     let buf = b"hello world".take(100);
10     assert_eq!(11, buf.remaining());
11     assert_eq!(b"hello world", buf.chunk());
12 }
13