move tests
This commit is contained in:
parent
6407e2e789
commit
aac23f7832
@ -222,3 +222,42 @@ fn baz {
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_match_group_empty_fixed_token() {
|
||||
check(
|
||||
r#"
|
||||
macro_rules! m {
|
||||
($($i:ident)* #abc) => ( fn baz { $($i ();)* } );
|
||||
}
|
||||
m!{#abc}
|
||||
"#,
|
||||
expect![[r##"
|
||||
macro_rules! m {
|
||||
($($i:ident)* #abc) => ( fn baz { $($i ();)* } );
|
||||
}
|
||||
fn baz {}
|
||||
"##]],
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_match_group_in_subtree() {
|
||||
check(
|
||||
r#"
|
||||
macro_rules! m {
|
||||
(fn $name:ident { $($i:ident)* } ) => ( fn $name() { $($i ();)* } );
|
||||
}
|
||||
m! {fn baz { a b } }
|
||||
"#,
|
||||
expect![[r#"
|
||||
macro_rules! m {
|
||||
(fn $name:ident { $($i:ident)* } ) => ( fn $name() { $($i ();)* } );
|
||||
}
|
||||
fn baz() {
|
||||
a();
|
||||
b();
|
||||
}
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
|
@ -209,33 +209,6 @@ macro_rules! foo {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_match_group_empty_fixed_token() {
|
||||
parse_macro(
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
($ ($ i:ident)* #abc) => ( fn baz { $ (
|
||||
$ i ();
|
||||
)*} );
|
||||
}
|
||||
"#,
|
||||
)
|
||||
.assert_expand_items("foo! {#abc}", "fn baz {}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_match_group_in_subtree() {
|
||||
parse_macro(
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
(fn $name:ident {$($i:ident)*} ) => ( fn $name() { $ (
|
||||
$ i ();
|
||||
)*} );
|
||||
}"#,
|
||||
)
|
||||
.assert_expand_items("foo! {fn baz {a b} }", "fn baz () {a () ; b () ;}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_match_group_with_multichar_sep() {
|
||||
parse_macro(
|
||||
|
Loading…
Reference in New Issue
Block a user