Michael Bradshaw | 7531e15 | 2018-10-19 22:26:56 -0700 | [diff] [blame] | 1 | extern crate quote; |
| 2 | extern crate syn; |
| 3 | |
David Tolnay | c3f9856 | 2018-11-02 08:55:05 -0700 | [diff] [blame] | 4 | mod features; |
| 5 | |
David Tolnay | 7d8b331 | 2019-03-10 01:26:11 -0800 | [diff] [blame] | 6 | use quote::quote; |
| 7 | use syn::Pat; |
| 8 | |
Michael Bradshaw | 7531e15 | 2018-10-19 22:26:56 -0700 | [diff] [blame] | 9 | #[test] |
| 10 | fn test_pat_ident() { |
David Tolnay | 845c866 | 2018-10-20 08:12:25 -0400 | [diff] [blame] | 11 | match syn::parse2(quote!(self)).unwrap() { |
David Tolnay | 7d8b331 | 2019-03-10 01:26:11 -0800 | [diff] [blame] | 12 | Pat::Ident(_) => (), |
David Tolnay | 845c866 | 2018-10-20 08:12:25 -0400 | [diff] [blame] | 13 | value => panic!("expected PatIdent, got {:?}", value), |
| 14 | } |
Michael Bradshaw | 7531e15 | 2018-10-19 22:26:56 -0700 | [diff] [blame] | 15 | } |
| 16 | |
| 17 | #[test] |
| 18 | fn test_pat_path() { |
David Tolnay | 845c866 | 2018-10-20 08:12:25 -0400 | [diff] [blame] | 19 | match syn::parse2(quote!(self::CONST)).unwrap() { |
David Tolnay | 7d8b331 | 2019-03-10 01:26:11 -0800 | [diff] [blame] | 20 | Pat::Path(_) => (), |
David Tolnay | 845c866 | 2018-10-20 08:12:25 -0400 | [diff] [blame] | 21 | value => panic!("expected PatPath, got {:?}", value), |
| 22 | } |
| 23 | } |