Add some tests for Limit, BytesMut and Reader (#785)

This commit is contained in:
Hange Shi - NJU
2025-05-28 12:56:41 +02:00
committed by GitHub
parent d9d5c59ef8
commit f29e93951d
3 changed files with 102 additions and 0 deletions
+7
View File
@@ -186,6 +186,13 @@ fn split_off_oob() {
let _ = hello.split_off(44);
}
#[test]
#[should_panic = "split_off out of bounds"]
fn bytes_mut_split_off_oob() {
let mut hello = BytesMut::from(&b"helloworld"[..]);
let _ = hello.split_off(44);
}
#[test]
fn split_off_uninitialized() {
let mut bytes = BytesMut::with_capacity(1024);