Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/syn-2.0.119/tests/test_asyncness.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers 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] 8 mod snapshot; 9 10 mod debug; 11 12 use syn::{Expr, Item}; 13 14 #[test] 15 fn 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] 35 fn 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 }