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
6 changes: 3 additions & 3 deletions tests/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn put_int() {
}

#[test]
#[should_panic]
#[should_panic(expected = "size too large")]
fn put_int_nbytes_overflow() {
let mut buf = SmallVec::with_capacity(8);
buf.put_int(0x1020304050607080, 9);
Expand All @@ -74,14 +74,14 @@ fn put_int_le() {
}

#[test]
#[should_panic]
#[should_panic(expected = "size too large")]
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")]
#[should_panic(expected = "advance out of bounds")]
fn smallvec_advance_mut() {
let mut buf = SmallVec::with_capacity(8);
unsafe {
Expand Down
12 changes: 6 additions & 6 deletions tests/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,15 +403,15 @@ fn append() {
}

#[test]
#[should_panic]
#[should_panic(expected = "new_capacity >= len")]
fn invalid_grow() {
let mut v: SmallVec<u8, 8> = SmallVec::new();
v.extend(0..8);
v.grow(5);
}

#[test]
#[should_panic]
#[should_panic(expected = "attempted to index slice up to maximum usize")]
fn drain_overflow() {
let mut v: SmallVec<u8, 8> = SmallVec::from([0]);
v.drain(..=usize::MAX);
Expand Down Expand Up @@ -442,7 +442,7 @@ fn extend_from_within() {
}

#[test]
#[should_panic]
#[should_panic(expected = "drop")]
fn drop_panic_smallvec() {
// This test should only panic once, and not double panic,
// which would mean a double drop
Expand Down Expand Up @@ -969,21 +969,21 @@ fn max_dont_panic() {
}

#[test]
#[should_panic]
#[should_panic(expected = "removal index")]
fn max_remove() {
let mut sv: SmallVec<i32, 2> = SmallVec::from([0]);
sv.remove(usize::MAX);
}

#[test]
#[should_panic]
#[should_panic(expected = "swap_remove index")]
fn max_swap_remove() {
let mut sv: SmallVec<i32, 2> = SmallVec::from([0]);
sv.swap_remove(usize::MAX);
}

#[test]
#[should_panic]
#[should_panic(expected = "insertion index")]
fn max_insert() {
let mut sv: SmallVec<i32, 2> = SmallVec::from([0]);
sv.insert(usize::MAX, 0);
Expand Down
Loading