[wip] unit testing

- styling, `test_util::make_check_trait_panic`
This commit is contained in:
Jörn-Michael Miehe 2025-07-12 01:32:10 +00:00
parent 6167ebc98a
commit 2900715a74
2 changed files with 7 additions and 1 deletions

View file

@ -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::<u64>(usize::MAX), u64::MAX);

View file

@ -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");
}