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
+9
View File
@@ -27,3 +27,12 @@ fn buf_read() {
reader.read_line(&mut line).unwrap();
assert_eq!("world", &line);
}
#[test]
fn get_mut() {
let buf = &b"hello world"[..];
let mut reader = buf.reader();
let buf_mut = reader.get_mut();
assert_eq!(11, buf_mut.remaining());
assert_eq!(b"hello world", buf_mut);
}