1 // compile-flags: --test
3 #[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function
6 #[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function
7 mod loooooooooooooong_teeeeeeeeeest {
10 this comment goes on for a very long time
11 this is to pad out the span for this module for a long time
12 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
13 labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
14 laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
15 voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
16 non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
20 #[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function
23 #[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function
26 #[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function
29 #[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function
30 const FOO: i32 = -1_i32;
32 #[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function
33 static BAR: u64 = 10_000_u64;
35 #[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function
40 #[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function
43 #[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function
50 #[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function
51 #[derive(Copy, Clone, Debug)]
61 #[test] //~ WARN: the `#[test]` attribute may only be used on a non-associated function
64 // make sure it doesn't erroneously trigger on a real test
67 assert_eq!(42_i32, 42_i32);
70 // make sure it works with cfg test