]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/test-should-panic-attr.rs
rustdoc: Hide `self: Box<Self>` in list of deref methods
[rust.git] / src / test / run-pass / test-should-panic-attr.rs
1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // compile-flags: --test
12
13 #[test]
14 #[should_panic = "foo"]
15 //~^ WARN: attribute must be of the form:
16 fn test1() {
17     panic!();
18 }
19
20 #[test]
21 #[should_panic(expected)]
22 //~^ WARN: argument must be of the form:
23 fn test2() {
24     panic!();
25 }
26
27 #[test]
28 #[should_panic(expect)]
29 //~^ WARN: argument must be of the form:
30 fn test3() {
31     panic!();
32 }
33
34 #[test]
35 #[should_panic(expected(foo, bar))]
36 //~^ WARN: argument must be of the form:
37 fn test4() {
38     panic!();
39 }
40
41 #[test]
42 #[should_panic(expected = "foo", bar)]
43 //~^ WARN: argument must be of the form:
44 fn test5() {
45     panic!();
46 }