• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #![allow(
2     clippy::elidable_lifetime_names,
3     clippy::needless_lifetimes,
4     clippy::uninlined_format_args
5 )]
6 
7 #[macro_use]
8 mod macros;
9 
10 use syn::{Expr, Item};
11 
12 #[test]
test_async_fn()13 fn test_async_fn() {
14     let input = "async fn process() {}";
15 
16     snapshot!(input as Item, @r#"
17     Item::Fn {
18         vis: Visibility::Inherited,
19         sig: Signature {
20             asyncness: Some,
21             ident: "process",
22             generics: Generics,
23             output: ReturnType::Default,
24         },
25         block: Block {
26             stmts: [],
27         },
28     }
29     "#);
30 }
31 
32 #[test]
test_async_closure()33 fn test_async_closure() {
34     let input = "async || {}";
35 
36     snapshot!(input as Expr, @r#"
37     Expr::Closure {
38         asyncness: Some,
39         output: ReturnType::Default,
40         body: Expr::Block {
41             block: Block {
42                 stmts: [],
43             },
44         },
45     }
46     "#);
47 }
48