internal: move tests
This commit is contained in:
parent
b2b703b2d7
commit
b1cfa51ef5
@ -383,3 +383,35 @@ fn baz() -> bool {
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_match_group_zero_match() {
|
||||
check(
|
||||
r#"
|
||||
macro_rules! m { ( $($i:ident)* ) => (); }
|
||||
m!();
|
||||
"#,
|
||||
expect![[r#"
|
||||
macro_rules! m { ( $($i:ident)* ) => (); }
|
||||
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_match_group_in_group() {
|
||||
check(
|
||||
r#"
|
||||
macro_rules! m {
|
||||
[ $( ( $($i:ident)* ) )* ] => [ x![$( ( $($i)* ) )*]; ]
|
||||
}
|
||||
m! ( (a b) );
|
||||
"#,
|
||||
expect![[r#"
|
||||
macro_rules! m {
|
||||
[ $( ( $($i:ident)* ) )* ] => [ x![$( ( $($i)* ) )*]; ]
|
||||
}
|
||||
x![(a b)];
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
|
@ -71,28 +71,6 @@ macro_rules! foobar {
|
||||
assert_eq!(get_text(tt::TokenId(13), T!['{']), "{");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_match_group_zero_match() {
|
||||
parse_macro(
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
( $($i:ident)* ) => ();
|
||||
}"#,
|
||||
)
|
||||
.assert_expand_items("foo! ();", "");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_match_group_in_group() {
|
||||
parse_macro(
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
{ $( ( $($i:ident)* ) )* } => ( $( ( $($i)* ) )* );
|
||||
}"#,
|
||||
)
|
||||
.assert_expand_items("foo! ( (a b) );", "(a b)");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_expand_to_item_list() {
|
||||
let tree = parse_macro(
|
||||
|
Loading…
Reference in New Issue
Block a user