rust/src/test/ui/test-attrs/test-should-fail-good-message.rs

15 lines
283 B
Rust
Raw Normal View History

// run-pass
// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: --test
#[test]
#[should_panic(expected = "foo")]
2015-03-15 15:00:41 -05:00
pub fn test_foo() {
panic!("foo bar")
}
#[test]
#[should_panic(expected = "foo")]
2015-03-15 15:00:41 -05:00
pub fn test_foo_dynamic() {
panic!("{} bar", "foo")
}