aboutsummaryrefslogtreecommitdiff
path: root/crates/mbe/src/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/mbe/src/tests.rs')
-rw-r--r--crates/mbe/src/tests.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/mbe/src/tests.rs b/crates/mbe/src/tests.rs
index dff6e98c2..451fa1456 100644
--- a/crates/mbe/src/tests.rs
+++ b/crates/mbe/src/tests.rs
@@ -992,6 +992,30 @@ fn test_tt_composite2() {
992} 992}
993 993
994#[test] 994#[test]
995fn test_underscore() {
996 parse_macro(
997 r#"
998 macro_rules! foo {
999 ($_:tt) => { 0 }
1000 }
1001 "#,
1002 )
1003 .assert_expand_items(r#"foo! { => }"#, r#"0"#);
1004}
1005
1006#[test]
1007fn test_vertical_bar_with_pat() {
1008 parse_macro(
1009 r#"
1010 macro_rules! foo {
1011 (| $pat:pat | ) => { 0 }
1012 }
1013 "#,
1014 )
1015 .assert_expand_items(r#"foo! { | x | }"#, r#"0"#);
1016}
1017
1018#[test]
995fn test_lifetime() { 1019fn test_lifetime() {
996 parse_macro( 1020 parse_macro(
997 r#" 1021 r#"