Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/arbitrary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use {
};

#[test]
fn test_arbitrary() {
fn arbitrary() {
// Deterministic for fixed input bytes; assert it builds a consistent
// SmallVec.
let mut u = Unstructured::new(&[0u8, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);
Expand Down
18 changes: 9 additions & 9 deletions tests/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use bytes::BufMut as _;
type SmallVec = smallvec::SmallVec<u8, 8>;

#[test]
fn test_smallvec_as_mut_buf() {
fn smallvec_as_mut_buf() {
let mut buf = SmallVec::with_capacity(64);

assert_eq!(buf.remaining_mut(), isize::MAX as usize);
Expand All @@ -27,22 +27,22 @@ fn test_smallvec_as_mut_buf() {
}

#[test]
fn test_smallvec_put_bytes() {
fn smallvec_put_bytes() {
let mut buf = SmallVec::new();
buf.push(17);
buf.put_bytes(19, 2);
assert_eq!([17, 19, 19], &buf[..]);
}

#[test]
fn test_put_u8() {
fn put_u8() {
let mut buf = SmallVec::with_capacity(8);
buf.put_u8(33);
assert_eq!(b"\x21", &buf[..]);
}

#[test]
fn test_put_u16() {
fn put_u16() {
let mut buf = SmallVec::with_capacity(8);
buf.put_u16(8532);
assert_eq!(b"\x21\x54", &buf[..]);
Expand All @@ -53,36 +53,36 @@ fn test_put_u16() {
}

#[test]
fn test_put_int() {
fn put_int() {
let mut buf = SmallVec::with_capacity(8);
buf.put_int(0x1020304050607080, 3);
assert_eq!(b"\x60\x70\x80", &buf[..]);
}

#[test]
#[should_panic]
fn test_put_int_nbytes_overflow() {
fn put_int_nbytes_overflow() {
let mut buf = SmallVec::with_capacity(8);
buf.put_int(0x1020304050607080, 9);
}

#[test]
fn test_put_int_le() {
fn put_int_le() {
let mut buf = SmallVec::with_capacity(8);
buf.put_int_le(0x1020304050607080, 3);
assert_eq!(b"\x80\x70\x60", &buf[..]);
}

#[test]
#[should_panic]
fn test_put_int_le_nbytes_overflow() {
fn put_int_le_nbytes_overflow() {
let mut buf = SmallVec::with_capacity(8);
buf.put_int_le(0x1020304050607080, 9);
}

#[test]
#[should_panic(expected = "advance out of bounds: the len is 8 but advancing by 12")]
fn test_smallvec_advance_mut() {
fn smallvec_advance_mut() {
let mut buf = SmallVec::with_capacity(8);
unsafe {
buf.advance_mut(12);
Expand Down
Loading
Loading