summaryrefslogtreecommitdiffstats
path: root/rust/vendor/syn-0.15.44/tests/test_pat.rs
blob: 1343aa646f477b488018858aed642799b7c49972 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
extern crate quote;
extern crate syn;

mod features;

use quote::quote;
use syn::Pat;

#[test]
fn test_pat_ident() {
    match syn::parse2(quote!(self)).unwrap() {
        Pat::Ident(_) => (),
        value => panic!("expected PatIdent, got {:?}", value),
    }
}

#[test]
fn test_pat_path() {
    match syn::parse2(quote!(self::CONST)).unwrap() {
        Pat::Path(_) => (),
        value => panic!("expected PatPath, got {:?}", value),
    }
}