2016-11-13 19:39:27 +10:30
|
|
|
//@ compile-flags: --test
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
#[should_panic = "foo"]
|
|
|
|
|
fn test1() {
|
|
|
|
|
panic!();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
#[should_panic(expected)]
|
2025-07-11 18:37:00 +02:00
|
|
|
//~^ ERROR malformed `should_panic` attribute input
|
|
|
|
|
//~| NOTE expected this to be of the form `expected = "..."`
|
2025-08-11 17:02:32 +00:00
|
|
|
//~| NOTE for more information, visit
|
2016-11-13 19:39:27 +10:30
|
|
|
fn test2() {
|
|
|
|
|
panic!();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
#[should_panic(expect)]
|
2025-07-11 18:37:00 +02:00
|
|
|
//~^ ERROR malformed `should_panic` attribute input
|
|
|
|
|
//~| NOTE the only valid argument here is "expected"
|
2025-08-11 17:02:32 +00:00
|
|
|
//~| NOTE for more information, visit
|
2016-11-13 19:39:27 +10:30
|
|
|
fn test3() {
|
|
|
|
|
panic!();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
#[should_panic(expected(foo, bar))]
|
2025-07-11 18:37:00 +02:00
|
|
|
//~^ ERROR malformed `should_panic` attribute input
|
|
|
|
|
//~| NOTE expected this to be of the form `expected = "..."`
|
2025-08-11 17:02:32 +00:00
|
|
|
//~| NOTE for more information, visit
|
2016-11-13 19:39:27 +10:30
|
|
|
fn test4() {
|
|
|
|
|
panic!();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
#[should_panic(expected = "foo", bar)]
|
2025-07-11 18:37:00 +02:00
|
|
|
//~^ ERROR malformed `should_panic` attribute input
|
|
|
|
|
//~| NOTE expected a single argument here
|
2025-08-11 17:02:32 +00:00
|
|
|
//~| NOTE for more information, visit
|
2016-11-13 19:39:27 +10:30
|
|
|
fn test5() {
|
|
|
|
|
panic!();
|
|
|
|
|
}
|