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.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/ra_mbe/src/lib.rs b/crates/ra_mbe/src/lib.rs
index b9dd22dc9..074be9043 100644
--- a/crates/ra_mbe/src/lib.rs
+++ b/crates/ra_mbe/src/lib.rs
@@ -809,4 +809,16 @@ MACRO_ITEMS@[0; 40)
809 ); 809 );
810 assert_expansion(&rules, r#"foo!(u8 0)"#, r#"const VALUE: u8 = 0;"#); 810 assert_expansion(&rules, r#"foo!(u8 0)"#, r#"const VALUE: u8 = 0;"#);
811 } 811 }
812
813 #[test]
814 fn test_vis() {
815 let rules = create_rules(
816 r#"
817 macro_rules! foo {
818 ($ vis:vis $ name:ident) => { $ vis fn $ name() {}};
819 }
820"#,
821 );
822 assert_expansion(&rules, r#"foo!(pub foo);"#, r#"pub fn foo() {}"#);
823 }
812} 824}