aboutsummaryrefslogtreecommitdiff
path: root/crates/mbe/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'crates/mbe/src/tests')
-rw-r--r--crates/mbe/src/tests/expand.rs15
-rw-r--r--crates/mbe/src/tests/rule.rs2
2 files changed, 16 insertions, 1 deletions
diff --git a/crates/mbe/src/tests/expand.rs b/crates/mbe/src/tests/expand.rs
index 8951f3813..e02d038b6 100644
--- a/crates/mbe/src/tests/expand.rs
+++ b/crates/mbe/src/tests/expand.rs
@@ -663,6 +663,21 @@ macro foo {
663} 663}
664 664
665#[test] 665#[test]
666fn test_macro_2_0_panic_2015() {
667 parse_macro2(
668 r#"
669macro panic_2015 {
670 () => (
671 ),
672 (bar) => (
673 ),
674}
675"#,
676 )
677 .assert_expand_items("panic_2015!(bar);", "");
678}
679
680#[test]
666fn test_path() { 681fn test_path() {
667 parse_macro( 682 parse_macro(
668 r#" 683 r#"
diff --git a/crates/mbe/src/tests/rule.rs b/crates/mbe/src/tests/rule.rs
index bf48112b3..5c61a98fd 100644
--- a/crates/mbe/src/tests/rule.rs
+++ b/crates/mbe/src/tests/rule.rs
@@ -44,6 +44,6 @@ fn parse_macro_arm(arm_definition: &str) -> Result<crate::MacroRules, ParseError
44 let macro_definition = 44 let macro_definition =
45 source_file.syntax().descendants().find_map(ast::MacroRules::cast).unwrap(); 45 source_file.syntax().descendants().find_map(ast::MacroRules::cast).unwrap();
46 46
47 let (definition_tt, _) = ast_to_token_tree(&macro_definition.token_tree().unwrap()).unwrap(); 47 let (definition_tt, _) = ast_to_token_tree(&macro_definition.token_tree().unwrap());
48 crate::MacroRules::parse(&definition_tt) 48 crate::MacroRules::parse(&definition_tt)
49} 49}