internal: move test

This commit is contained in:
Aleksey Kladov 2021-10-09 18:49:14 +03:00
parent 993ff1c239
commit 0a32c20142
2 changed files with 21 additions and 14 deletions

View file

@ -475,3 +475,24 @@ struct Bar {
"#]], "#]],
); );
} }
#[test]
fn test_two_idents() {
check(
r#"
macro_rules! m {
($i:ident, $j:ident) => { fn foo() { let a = $i; let b = $j; } }
}
m! { foo, bar }
"#,
expect![[r#"
macro_rules! m {
($i:ident, $j:ident) => { fn foo() { let a = $i; let b = $j; } }
}
fn foo() {
let a = foo;
let b = bar;
}
"#]],
);
}

View file

@ -107,20 +107,6 @@ fn test_attr_to_token_tree() {
); );
} }
#[test]
fn test_two_idents() {
parse_macro(
r#"
macro_rules! foo {
($ i:ident, $ j:ident) => {
fn foo() { let a = $ i; let b = $j; }
}
}
"#,
)
.assert_expand_items("foo! { foo, bar }", "fn foo () {let a = foo ; let b = bar ;}");
}
#[test] #[test]
fn test_tt_to_stmts() { fn test_tt_to_stmts() {
let stmts = parse_macro( let stmts = parse_macro(