When a #[should_panic] #[test] fails because there was no panic it should produce an error message to that effect.
For example, the following test:
#[test]
#[should_panic]
fn doesnt_actually_panic() {}
when run with cargo test produces the following output:
test doesnt_actually_panic ... FAILED
failures:
failures:
doesnt_actually_panic
There is no indication why it failed. Which can be problematic if the test itself is created by a macro. Example: https://github.com/BurntSushi/fst/blob/master/src/raw/tests.rs#L131-L140
When a
#[should_panic]#[test]fails because there was no panic it should produce an error message to that effect.For example, the following test:
when run with
cargo testproduces the following output:There is no indication why it failed. Which can be problematic if the test itself is created by a macro. Example: https://github.com/BurntSushi/fst/blob/master/src/raw/tests.rs#L131-L140