Impl Extend for BytesMut

This commit is contained in:
Carl Lerche
2017-03-07 15:06:47 -08:00
parent 06b94c55b0
commit 2e319b51be
2 changed files with 29 additions and 0 deletions
+7
View File
@@ -290,6 +290,13 @@ fn inline_storage() {
assert_eq!(*bytes, zero[0..inline_cap()]);
}
#[test]
fn extend() {
let mut bytes = BytesMut::with_capacity(0);
bytes.extend(LONG);
assert_eq!(*bytes, LONG[..]);
}
#[test]
fn stress() {
// Tests promoting a buffer from a vec -> shared in a concurrent situation