From c4173bb468500f6490921e8f8627d87b2aeb7af5 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sat, 17 Apr 2021 14:31:52 +0800 Subject: Handle extended key value attr in mbe --- crates/mbe/src/tests/expand.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'crates/mbe/src') diff --git a/crates/mbe/src/tests/expand.rs b/crates/mbe/src/tests/expand.rs index e02d038b6..146b236e2 100644 --- a/crates/mbe/src/tests/expand.rs +++ b/crates/mbe/src/tests/expand.rs @@ -940,6 +940,24 @@ fn test_meta_doc_comments() { ); } +#[test] +fn test_meta_extended_key_value_attributes() { + parse_macro( + r#" +macro_rules! foo { + (#[$i:meta]) => ( + #[$ i] + fn bar() {} + ) +} +"#, + ) + .assert_expand_items( + r#"foo! { #[doc = concat!("The `", "bla", "` lang item.")] }"#, + r#"# [doc = concat ! ("The `" , "bla" , "` lang item.")] fn bar () {}"#, + ); +} + #[test] fn test_meta_doc_comments_non_latin() { parse_macro( -- cgit v1.2.3