rust/tests/ui/test-attrs/test-should-fail-good-messa...

15 lines
243 B
Rust

//@ run-pass
//@ needs-unwind
//@ compile-flags: --test
#[test]
#[should_panic(expected = "foo")]
pub fn test_foo() {
panic!("foo bar")
}
#[test]
#[should_panic(expected = "foo")]
pub fn test_foo_dynamic() {
panic!("{} bar", "foo")
}