1 use tokio::test;
2 
3 #[test]
test_macro_can_be_used_via_use()4 async fn test_macro_can_be_used_via_use() {
5     tokio::spawn(async {}).await.unwrap();
6 }
7 
8 #[tokio::test]
test_macro_is_resilient_to_shadowing()9 async fn test_macro_is_resilient_to_shadowing() {
10     tokio::spawn(async {}).await.unwrap();
11 }
12 
13 // https://github.com/tokio-rs/tokio/issues/3403
14 #[rustfmt::skip] // this `rustfmt::skip` is necessary because unused_braces does not warn if the block contains newline.
15 #[tokio::main]
unused_braces_main()16 pub async fn unused_braces_main() { println!("hello") }
17 #[rustfmt::skip] // this `rustfmt::skip` is necessary because unused_braces does not warn if the block contains newline.
18 #[tokio::test]
unused_braces_test()19 async fn unused_braces_test() { assert_eq!(1 + 1, 2) }
20 
21 // https://github.com/tokio-rs/tokio/pull/3766#issuecomment-835508651
22 #[std::prelude::v1::test]
trait_method()23 fn trait_method() {
24     trait A {
25         fn f(self);
26     }
27     impl A for () {
28         #[tokio::main]
29         async fn f(self) {}
30     }
31     ().f()
32 }
33