1 | #[macro_use ] |
2 | mod macros; |
3 | |
4 | use syn::{Expr, Item}; |
5 | |
6 | #[test] |
7 | fn test_async_fn() { |
8 | let input = "async fn process() {}" ; |
9 | |
10 | snapshot!(input as Item, @r###" |
11 | Item::Fn { |
12 | vis: Inherited, |
13 | sig: Signature { |
14 | asyncness: Some, |
15 | ident: "process", |
16 | generics: Generics, |
17 | output: Default, |
18 | }, |
19 | block: Block, |
20 | } |
21 | "### ); |
22 | } |
23 | |
24 | #[test] |
25 | fn test_async_closure() { |
26 | let input = "async || {}" ; |
27 | |
28 | snapshot!(input as Expr, @r###" |
29 | Expr::Closure { |
30 | asyncness: Some, |
31 | output: Default, |
32 | body: Expr::Block { |
33 | block: Block, |
34 | }, |
35 | } |
36 | "### ); |
37 | } |
38 | |