From f942d10e8010918c677b40f821e504d87f057ead Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sun, 20 Dec 2020 17:13:40 +0800 Subject: Use pattern_single instead of pattern in mbe pat --- crates/mbe/src/tests.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'crates/mbe') 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 @@ -1003,6 +1003,18 @@ fn test_underscore() { .assert_expand_items(r#"foo! { => }"#, r#"0"#); } +#[test] +fn test_vertical_bar_with_pat() { + parse_macro( + r#" + macro_rules! foo { + (| $pat:pat | ) => { 0 } + } + "#, + ) + .assert_expand_items(r#"foo! { | x | }"#, r#"0"#); +} + #[test] fn test_lifetime() { parse_macro( -- cgit v1.2.3