]>
Commit | Line | Data |
---|---|---|
e74abb32 XL |
1 | mod features; |
2 | ||
3 | #[macro_use] | |
4 | mod macros; | |
5 | ||
6 | use proc_macro2::TokenStream; | |
7 | use quote::quote; | |
8 | use syn::Lit; | |
9 | ||
10 | #[test] | |
11 | fn test_struct() { | |
12 | let input = " | |
13 | #[derive(Debug, Clone)] | |
14 | pub struct Item { | |
15 | pub ident: Ident, | |
16 | pub attrs: Vec<Attribute>, | |
17 | } | |
18 | "; | |
19 | ||
20 | snapshot!(input as TokenStream, @"`# [ derive ( Debug , Clone ) ] pub struct Item { pub ident : Ident , pub attrs : Vec < Attribute >, }`"); | |
21 | } | |
22 | ||
23 | #[test] | |
24 | fn test_literal_mangling() { | |
25 | let code = "0_4"; | |
26 | let parsed: Lit = syn::parse_str(code).unwrap(); | |
27 | assert_eq!(code, quote!(#parsed).to_string()); | |
28 | } |