diff --git a/tests/bytes.rs b/tests/bytes.rs index 3c64053..9d77847 100644 --- a/tests/bytes.rs +++ b/tests/bytes.rs @@ -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); @@ -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 { diff --git a/tests/main.rs b/tests/main.rs index 31ad3a8..b74fd4e 100644 --- a/tests/main.rs +++ b/tests/main.rs @@ -403,7 +403,7 @@ fn append() { } #[test] -#[should_panic] +#[should_panic(expected = "new_capacity >= len")] fn invalid_grow() { let mut v: SmallVec = SmallVec::new(); v.extend(0..8); @@ -411,7 +411,7 @@ fn invalid_grow() { } #[test] -#[should_panic] +#[should_panic(expected = "attempted to index slice up to maximum usize")] fn drain_overflow() { let mut v: SmallVec = SmallVec::from([0]); v.drain(..=usize::MAX); @@ -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 @@ -969,21 +969,21 @@ fn max_dont_panic() { } #[test] -#[should_panic] +#[should_panic(expected = "removal index")] fn max_remove() { let mut sv: SmallVec = SmallVec::from([0]); sv.remove(usize::MAX); } #[test] -#[should_panic] +#[should_panic(expected = "swap_remove index")] fn max_swap_remove() { let mut sv: SmallVec = SmallVec::from([0]); sv.swap_remove(usize::MAX); } #[test] -#[should_panic] +#[should_panic(expected = "insertion index")] fn max_insert() { let mut sv: SmallVec = SmallVec::from([0]); sv.insert(usize::MAX, 0);