diff options
Diffstat (limited to 'tests/ui/test-attrs/test-should-fail-good-message.rs')
-rw-r--r-- | tests/ui/test-attrs/test-should-fail-good-message.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/test-attrs/test-should-fail-good-message.rs b/tests/ui/test-attrs/test-should-fail-good-message.rs new file mode 100644 index 000000000..83519c452 --- /dev/null +++ b/tests/ui/test-attrs/test-should-fail-good-message.rs @@ -0,0 +1,14 @@ +// 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") +} |