aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_mbe/src/lib.rs')
-rw-r--r--crates/ra_mbe/src/lib.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/ra_mbe/src/lib.rs b/crates/ra_mbe/src/lib.rs
index d7462d09d..ae8a62036 100644
--- a/crates/ra_mbe/src/lib.rs
+++ b/crates/ra_mbe/src/lib.rs
@@ -762,4 +762,28 @@ MACRO_ITEMS@[0; 40)
762 r#"# [cfg (target_os = "windows")] fn bar () {}"#, 762 r#"# [cfg (target_os = "windows")] fn bar () {}"#,
763 ); 763 );
764 } 764 }
765
766 #[test]
767 fn test_tt_block() {
768 let rules = create_rules(
769 r#"
770 macro_rules! foo {
771 ($ i:tt) => { fn foo() $ i }
772 }
773"#,
774 );
775 assert_expansion(&rules, r#"foo! { { 1; } }"#, r#"fn foo () {1 ;}"#);
776 }
777
778 #[test]
779 fn test_tt_group() {
780 let rules = create_rules(
781 r#"
782 macro_rules! foo {
783 ($($ i:tt)*) => { $($ i)* }
784 }
785"#,
786 );
787 assert_expansion(&rules, r#"foo! { fn foo() {} }"#, r#"fn foo () {}"#);
788 }
765} 789}