Macro test::assert_panics
Assert that the inner block panics.
If the block does not panic, the macro will.
Example
use test::assert_panics;
#[test]
fn test_panic() {
assert_panics!({
panic!("oops");
});
}
Run this example
Assert that the inner block panics.
If the block does not panic, the macro will.
use test::assert_panics;
#[test]
fn test_panic() {
assert_panics!({
panic!("oops");
});
}
Run this example