Michael Bradshaw | 7531e15 | 2018-10-19 22:26:56 -0700 | [diff] [blame] | 1 | // Copyright 2018 Syn Developers |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 4 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 5 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
| 6 | // option. This file may not be copied, modified, or distributed |
| 7 | // except according to those terms. |
| 8 | |
| 9 | #[macro_use] |
| 10 | extern crate quote; |
| 11 | extern crate syn; |
| 12 | |
| 13 | #[test] |
| 14 | fn test_pat_ident() { |
| 15 | match syn::parse2(quote!(self)).unwrap() { |
| 16 | syn::Pat::Ident(_) => (), |
| 17 | value => panic!("expected PatIdent, got {:?}", value), |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | #[test] |
| 22 | fn test_pat_path() { |
| 23 | match syn::parse2(quote!(self::CONST)).unwrap() { |
| 24 | syn::Pat::Path(_) => (), |
| 25 | value => panic!("expected PatPath, got {:?}", value), |
| 26 | } |
| 27 | } |