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_token_trees.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_token_trees.rs` 38 lines ยท 762 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 proc_macro2::TokenStream; 13 use quote::quote; 14 use syn::Lit; 15 16 #[test] 17 fn test_struct() { 18 let input = " 19 #[derive(Debug, Clone)] 20 pub struct Item { 21 pub ident: Ident, 22 pub attrs: Vec, 23 } 24 "; 25 26 snapshot!(input as TokenStream, @r##" 27 TokenStream( 28 `# [derive (Debug , Clone)] pub struct Item { pub ident : Ident , pub attrs : Vec < Attribute >, }`, 29 ) 30 "##); 31 } 32 33 #[test] 34 fn test_literal_mangling() { 35 let code = "0_4"; 36 let parsed: Lit = syn::parse_str(code).unwrap(); 37 assert_eq!(code, quote!(#parsed).to_string()); 38 }