mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-01 17:04:13 +00:00
44 lines
942 B
Rust
44 lines
942 B
Rust
//@ compile-flags: --test
|
|
|
|
#[test]
|
|
#[should_panic = "foo"]
|
|
fn test1() {
|
|
panic!();
|
|
}
|
|
|
|
#[test]
|
|
#[should_panic(expected)]
|
|
//~^ ERROR malformed `should_panic` attribute input
|
|
//~| NOTE expected this to be of the form `expected = "..."`
|
|
//~| NOTE for more information, visit
|
|
fn test2() {
|
|
panic!();
|
|
}
|
|
|
|
#[test]
|
|
#[should_panic(expect)]
|
|
//~^ ERROR malformed `should_panic` attribute input
|
|
//~| NOTE the only valid argument here is "expected"
|
|
//~| NOTE for more information, visit
|
|
fn test3() {
|
|
panic!();
|
|
}
|
|
|
|
#[test]
|
|
#[should_panic(expected(foo, bar))]
|
|
//~^ ERROR malformed `should_panic` attribute input
|
|
//~| NOTE expected this to be of the form `expected = "..."`
|
|
//~| NOTE for more information, visit
|
|
fn test4() {
|
|
panic!();
|
|
}
|
|
|
|
#[test]
|
|
#[should_panic(expected = "foo", bar)]
|
|
//~^ ERROR malformed `should_panic` attribute input
|
|
//~| NOTE expected a single argument here
|
|
//~| NOTE for more information, visit
|
|
fn test5() {
|
|
panic!();
|
|
}
|