diff --git a/src/file/chunk.rs b/src/file/chunk.rs index 1a70600..d97dfe2 100644 --- a/src/file/chunk.rs +++ b/src/file/chunk.rs @@ -112,7 +112,7 @@ mod tests { } #[test] - #[should_panic(expected = "did not fit into \"u32\"")] + #[should_panic = "did not fit into \"u32\""] fn test_usize_overflow_panics() { // works assert_eq!(from_usize_or_panic::(usize::MAX), u64::MAX); diff --git a/src/test_util/mod.rs b/src/test_util/mod.rs index abba60f..1e14475 100644 --- a/src/test_util/mod.rs +++ b/src/test_util/mod.rs @@ -28,3 +28,9 @@ pub fn create_file(data: &[u8]) -> NamedTempFile { tmp.write_all(data).unwrap(); tmp } + +#[test] +#[should_panic = "`impl foo for bar` expected: 1, actual: 0"] +fn make_check_trait_panic() { + check_trait(0, 1, "foo", "bar"); +}