diff options
author | Edwin Cheng <[email protected]> | 2021-04-17 07:31:52 +0100 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2021-04-17 07:31:52 +0100 |
commit | c4173bb468500f6490921e8f8627d87b2aeb7af5 (patch) | |
tree | d8f6d2d1c2d2aac12f333a7f9955a708d49bd28d /crates/mbe/src | |
parent | df5b6f7d459a367b191d5d540c7363d9e526eadf (diff) |
Handle extended key value attr in mbe
Diffstat (limited to 'crates/mbe/src')
-rw-r--r-- | crates/mbe/src/tests/expand.rs | 18 |
1 files changed, 18 insertions, 0 deletions
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 | |||
@@ -941,6 +941,24 @@ fn test_meta_doc_comments() { | |||
941 | } | 941 | } |
942 | 942 | ||
943 | #[test] | 943 | #[test] |
944 | fn test_meta_extended_key_value_attributes() { | ||
945 | parse_macro( | ||
946 | r#" | ||
947 | macro_rules! foo { | ||
948 | (#[$i:meta]) => ( | ||
949 | #[$ i] | ||
950 | fn bar() {} | ||
951 | ) | ||
952 | } | ||
953 | "#, | ||
954 | ) | ||
955 | .assert_expand_items( | ||
956 | r#"foo! { #[doc = concat!("The `", "bla", "` lang item.")] }"#, | ||
957 | r#"# [doc = concat ! ("The `" , "bla" , "` lang item.")] fn bar () {}"#, | ||
958 | ); | ||
959 | } | ||
960 | |||
961 | #[test] | ||
944 | fn test_meta_doc_comments_non_latin() { | 962 | fn test_meta_doc_comments_non_latin() { |
945 | parse_macro( | 963 | parse_macro( |
946 | r#" | 964 | r#" |