1 extern crate quote; 2 extern crate syn; 3 4 mod features; 5 6 use quote::quote; 7 use syn::Pat; 8 9 #[test] test_pat_ident()10fn test_pat_ident() { 11 match syn::parse2(quote!(self)).unwrap() { 12 Pat::Ident(_) => (), 13 value => panic!("expected PatIdent, got {:?}", value), 14 } 15 } 16 17 #[test] test_pat_path()18fn test_pat_path() { 19 match syn::parse2(quote!(self::CONST)).unwrap() { 20 Pat::Path(_) => (), 21 value => panic!("expected PatPath, got {:?}", value), 22 } 23 } 24