diff options
author | Edwin Cheng <[email protected]> | 2020-12-20 09:13:40 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2020-12-20 09:13:40 +0000 |
commit | f942d10e8010918c677b40f821e504d87f057ead (patch) | |
tree | df7be57bbd282b79ad964db4bf2704874a0b2035 /crates/mbe | |
parent | f3125555a8de6fad4529408436800a6b1243a442 (diff) |
Use pattern_single instead of pattern in mbe pat
Diffstat (limited to 'crates/mbe')
-rw-r--r-- | crates/mbe/src/tests.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/mbe/src/tests.rs b/crates/mbe/src/tests.rs index f10e7a9b6..451fa1456 100644 --- a/crates/mbe/src/tests.rs +++ b/crates/mbe/src/tests.rs | |||
@@ -1004,6 +1004,18 @@ fn test_underscore() { | |||
1004 | } | 1004 | } |
1005 | 1005 | ||
1006 | #[test] | 1006 | #[test] |
1007 | fn test_vertical_bar_with_pat() { | ||
1008 | parse_macro( | ||
1009 | r#" | ||
1010 | macro_rules! foo { | ||
1011 | (| $pat:pat | ) => { 0 } | ||
1012 | } | ||
1013 | "#, | ||
1014 | ) | ||
1015 | .assert_expand_items(r#"foo! { | x | }"#, r#"0"#); | ||
1016 | } | ||
1017 | |||
1018 | #[test] | ||
1007 | fn test_lifetime() { | 1019 | fn test_lifetime() { |
1008 | parse_macro( | 1020 | parse_macro( |
1009 | r#" | 1021 | r#" |