mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-07 00:00:13 +02:00
Add missing tests in test_bytes
This commit is contained in:
@@ -157,6 +157,13 @@ fn slice_oob_2() {
|
||||
a.slice(44..49);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn slice_start_greater_than_end() {
|
||||
let a = Bytes::from(&b"hello world"[..]);
|
||||
a.slice(5..3);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn split_off() {
|
||||
let mut hello = Bytes::from(&b"helloworld"[..]);
|
||||
@@ -724,6 +731,15 @@ fn advance_past_len() {
|
||||
a.advance(20);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn mut_advance_past_len() {
|
||||
let mut a = BytesMut::from("hello world");
|
||||
unsafe {
|
||||
a.advance_mut(20);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
// Only run these tests on little endian systems. CI uses qemu for testing
|
||||
// big endian... and qemu doesn't really support threading all that well.
|
||||
|
||||
Reference in New Issue
Block a user