add tt matcher
This commit is contained in:
@@ -762,4 +762,28 @@ MACRO_ITEMS@[0; 40)
|
||||
r#"# [cfg (target_os = "windows")] fn bar () {}"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_tt_block() {
|
||||
let rules = create_rules(
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
($ i:tt) => { fn foo() $ i }
|
||||
}
|
||||
"#,
|
||||
);
|
||||
assert_expansion(&rules, r#"foo! { { 1; } }"#, r#"fn foo () {1 ;}"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_tt_group() {
|
||||
let rules = create_rules(
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
($($ i:tt)*) => { $($ i)* }
|
||||
}
|
||||
"#,
|
||||
);
|
||||
assert_expansion(&rules, r#"foo! { fn foo() {} }"#, r#"fn foo () {}"#);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user