blob: 70203133402e83573322e4e74e95a7009bc8e56c [file] [log] [blame]
Michael Bradshaw7531e152018-10-19 22:26:56 -07001// 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]
10extern crate quote;
11extern crate syn;
12
13#[test]
14fn test_pat_ident() {
David Tolnay845c8662018-10-20 08:12:25 -040015 match syn::parse2(quote!(self)).unwrap() {
16 syn::Pat::Ident(_) => (),
17 value => panic!("expected PatIdent, got {:?}", value),
18 }
Michael Bradshaw7531e152018-10-19 22:26:56 -070019}
20
21#[test]
22fn test_pat_path() {
David Tolnay845c8662018-10-20 08:12:25 -040023 match syn::parse2(quote!(self::CONST)).unwrap() {
24 syn::Pat::Path(_) => (),
25 value => panic!("expected PatPath, got {:?}", value),
26 }
27}