aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe/src/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_mbe/src/tests.rs')
-rw-r--r--crates/ra_mbe/src/tests.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/ra_mbe/src/tests.rs b/crates/ra_mbe/src/tests.rs
index 004faf77e..e3a5ceecf 100644
--- a/crates/ra_mbe/src/tests.rs
+++ b/crates/ra_mbe/src/tests.rs
@@ -575,6 +575,20 @@ fn test_tt_to_stmts() {
575 ); 575 );
576} 576}
577 577
578#[test]
579fn test_match_literal() {
580 let rules = create_rules(
581 r#"
582 macro_rules! foo {
583 ('(') => {
584 fn foo() {}
585 }
586 }
587"#,
588 );
589 assert_expansion(MacroKind::Items, &rules, "foo! ['(']", "fn foo () {}");
590}
591
578// The following tests are port from intellij-rust directly 592// The following tests are port from intellij-rust directly
579// https://github.com/intellij-rust/intellij-rust/blob/c4e9feee4ad46e7953b1948c112533360b6087bb/src/test/kotlin/org/rust/lang/core/macros/RsMacroExpansionTest.kt 593// https://github.com/intellij-rust/intellij-rust/blob/c4e9feee4ad46e7953b1948c112533360b6087bb/src/test/kotlin/org/rust/lang/core/macros/RsMacroExpansionTest.kt
580 594