aboutsummaryrefslogtreecommitdiff
path: root/syn/tests/test_pat.rs
diff options
context:
space:
mode:
Diffstat (limited to 'syn/tests/test_pat.rs')
-rw-r--r--syn/tests/test_pat.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/syn/tests/test_pat.rs b/syn/tests/test_pat.rs
new file mode 100644
index 0000000..cce4b80
--- /dev/null
+++ b/syn/tests/test_pat.rs
@@ -0,0 +1,20 @@
+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),
+ }
+}