aboutsummaryrefslogtreecommitdiff
path: root/crates/mbe/src/tests
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2021-04-17 07:31:52 +0100
committerEdwin Cheng <[email protected]>2021-04-17 07:31:52 +0100
commitc4173bb468500f6490921e8f8627d87b2aeb7af5 (patch)
treed8f6d2d1c2d2aac12f333a7f9955a708d49bd28d /crates/mbe/src/tests
parentdf5b6f7d459a367b191d5d540c7363d9e526eadf (diff)
Handle extended key value attr in mbe
Diffstat (limited to 'crates/mbe/src/tests')
-rw-r--r--crates/mbe/src/tests/expand.rs18
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]
944fn test_meta_extended_key_value_attributes() {
945 parse_macro(
946 r#"
947macro_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]
944fn test_meta_doc_comments_non_latin() { 962fn test_meta_doc_comments_non_latin() {
945 parse_macro( 963 parse_macro(
946 r#" 964 r#"