aboutsummaryrefslogtreecommitdiff
path: root/tests/test_bytes.rs
diff options
context:
space:
mode:
authorGravatar Pavel Strakhov <ri@idzaaus.org> 2019-04-03 02:24:30 +0300
committerGravatar Carl Lerche <me@carllerche.com> 2019-04-02 16:24:30 -0700
commitd43e283e5ed520e54df2428f2cf9a7c13c79ff49 (patch)
treef8d977db52e3962c373d08c3eb7df8cfb431fe43 /tests/test_bytes.rs
parente0e30f00a1248b1de59405da66cd871ccace4f9f (diff)
downloadbytes-d43e283e5ed520e54df2428f2cf9a7c13c79ff49.tar.gz
bytes-d43e283e5ed520e54df2428f2cf9a7c13c79ff49.tar.zst
bytes-d43e283e5ed520e54df2428f2cf9a7c13c79ff49.zip
Panic in BytesMut::split_to when out of bounds (#252) (#253)v0.4.x
Diffstat (limited to 'tests/test_bytes.rs')
-rw-r--r--tests/test_bytes.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/test_bytes.rs b/tests/test_bytes.rs
index 4cf340e..e188354 100644
--- a/tests/test_bytes.rs
+++ b/tests/test_bytes.rs
@@ -258,15 +258,10 @@ fn split_to_oob_mut() {
}
#[test]
+#[should_panic]
fn split_to_uninitialized() {
let mut bytes = BytesMut::with_capacity(1024);
- let other = bytes.split_to(128);
-
- assert_eq!(bytes.len(), 0);
- assert_eq!(bytes.capacity(), 896);
-
- assert_eq!(other.len(), 0);
- assert_eq!(other.capacity(), 128);
+ let _other = bytes.split_to(128);
}
#[test]