[wip] unit testing
- styling, `test_util::make_check_trait_panic`
This commit is contained in:
parent
6167ebc98a
commit
2900715a74
2 changed files with 7 additions and 1 deletions
|
|
@ -112,7 +112,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[should_panic(expected = "did not fit into \"u32\"")]
|
#[should_panic = "did not fit into \"u32\""]
|
||||||
fn test_usize_overflow_panics() {
|
fn test_usize_overflow_panics() {
|
||||||
// works
|
// works
|
||||||
assert_eq!(from_usize_or_panic::<u64>(usize::MAX), u64::MAX);
|
assert_eq!(from_usize_or_panic::<u64>(usize::MAX), u64::MAX);
|
||||||
|
|
|
||||||
|
|
@ -28,3 +28,9 @@ pub fn create_file(data: &[u8]) -> NamedTempFile {
|
||||||
tmp.write_all(data).unwrap();
|
tmp.write_all(data).unwrap();
|
||||||
tmp
|
tmp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[should_panic = "`impl foo for bar` expected: 1, actual: 0"]
|
||||||
|
fn make_check_trait_panic() {
|
||||||
|
check_trait(0, 1, "foo", "bar");
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue