blob: 1343aa646f477b488018858aed642799b7c49972 [file] [log] [blame]
Michael Bradshaw7531e152018-10-19 22:26:56 -07001extern crate quote;
2extern crate syn;
3
David Tolnayc3f98562018-11-02 08:55:05 -07004mod features;
5
David Tolnay7d8b3312019-03-10 01:26:11 -08006use quote::quote;
7use syn::Pat;
8
Michael Bradshaw7531e152018-10-19 22:26:56 -07009#[test]
10fn test_pat_ident() {
David Tolnay845c8662018-10-20 08:12:25 -040011 match syn::parse2(quote!(self)).unwrap() {
David Tolnay7d8b3312019-03-10 01:26:11 -080012 Pat::Ident(_) => (),
David Tolnay845c8662018-10-20 08:12:25 -040013 value => panic!("expected PatIdent, got {:?}", value),
14 }
Michael Bradshaw7531e152018-10-19 22:26:56 -070015}
16
17#[test]
18fn test_pat_path() {
David Tolnay845c8662018-10-20 08:12:25 -040019 match syn::parse2(quote!(self::CONST)).unwrap() {
David Tolnay7d8b3312019-03-10 01:26:11 -080020 Pat::Path(_) => (),
David Tolnay845c8662018-10-20 08:12:25 -040021 value => panic!("expected PatPath, got {:?}", value),
22 }
23}