From bced02c5dc636c7b88aeadf9eefa66f8cf06103e Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Fri, 8 Jan 2021 14:00:23 +0800 Subject: Add test --- crates/mbe/src/tests.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'crates/mbe') diff --git a/crates/mbe/src/tests.rs b/crates/mbe/src/tests.rs index 1d9afb4fb..d854985c5 100644 --- a/crates/mbe/src/tests.rs +++ b/crates/mbe/src/tests.rs @@ -1079,6 +1079,19 @@ fn test_vertical_bar_with_pat() { .assert_expand_items(r#"foo! { | x | }"#, r#"0"#); } +#[test] +fn test_dollar_crate_lhs_is_not_meta() { + parse_macro( + r#" +macro_rules! foo { + ($crate) => {}; + () => {0}; +} + "#, + ) + .assert_expand_items(r#"foo!{}"#, r#"0"#); +} + #[test] fn test_lifetime() { parse_macro( -- cgit v1.2.3