]> git.lizzy.rs Git - rust.git/blob - src/test/ui/test-attrs/test-should-panic-attr.rs
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / test-attrs / test-should-panic-attr.rs
1 // check-pass
2 // compile-flags: --test
3
4 #[test]
5 #[should_panic = "foo"]
6 fn test1() {
7     panic!();
8 }
9
10 #[test]
11 #[should_panic(expected)]
12 //~^ WARN: argument must be of the form:
13 fn test2() {
14     panic!();
15 }
16
17 #[test]
18 #[should_panic(expect)]
19 //~^ WARN: argument must be of the form:
20 fn test3() {
21     panic!();
22 }
23
24 #[test]
25 #[should_panic(expected(foo, bar))]
26 //~^ WARN: argument must be of the form:
27 fn test4() {
28     panic!();
29 }
30
31 #[test]
32 #[should_panic(expected = "foo", bar)]
33 //~^ WARN: argument must be of the form:
34 fn test5() {
35     panic!();
36 }