interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / vendor / syn-2.0.119 / tests / test_asyncness.rs

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