move test
This commit is contained in:
parent
b0a104cbd1
commit
408475a593
@ -878,3 +878,61 @@ mod c {}
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_all_items() {
|
||||
check(
|
||||
r#"
|
||||
macro_rules! m { ($($i:item)*) => ($($i )*) }
|
||||
m! {
|
||||
extern crate a;
|
||||
mod b;
|
||||
mod c {}
|
||||
use d;
|
||||
const E: i32 = 0;
|
||||
static F: i32 = 0;
|
||||
impl G {}
|
||||
struct H;
|
||||
enum I { Foo }
|
||||
trait J {}
|
||||
fn h() {}
|
||||
extern {}
|
||||
type T = u8;
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
macro_rules! m { ($($i:item)*) => ($($i )*) }
|
||||
extern crate a;
|
||||
mod b;
|
||||
mod c {}
|
||||
use d;
|
||||
const E:i32 = 0;
|
||||
static F:i32 = 0;
|
||||
impl G {}
|
||||
struct H;
|
||||
enum I {
|
||||
Foo
|
||||
}
|
||||
trait J {}
|
||||
fn h() {}
|
||||
extern {}
|
||||
type T = u8;
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_block() {
|
||||
check(
|
||||
r#"
|
||||
macro_rules! m { ($b:block) => { fn foo() $b } }
|
||||
m! { { 1; } }
|
||||
"#,
|
||||
expect![[r#"
|
||||
macro_rules! m { ($b:block) => { fn foo() $b } }
|
||||
fn foo() {
|
||||
1;
|
||||
}
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
@ -101,51 +101,6 @@ fn test_attr_to_token_tree() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_all_items() {
|
||||
parse_macro(
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
($ ($ i:item)*) => ($ (
|
||||
$ i
|
||||
)*)
|
||||
}
|
||||
"#,
|
||||
).
|
||||
assert_expand_items(
|
||||
r#"
|
||||
foo! {
|
||||
extern crate a;
|
||||
mod b;
|
||||
mod c {}
|
||||
use d;
|
||||
const E: i32 = 0;
|
||||
static F: i32 = 0;
|
||||
impl G {}
|
||||
struct H;
|
||||
enum I { Foo }
|
||||
trait J {}
|
||||
fn h() {}
|
||||
extern {}
|
||||
type T = u8;
|
||||
}
|
||||
"#,
|
||||
r#"extern crate a ; mod b ; mod c {} use d ; const E : i32 = 0 ; static F : i32 = 0 ; impl G {} struct H ; enum I {Foo} trait J {} fn h () {} extern {} type T = u8 ;"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_block() {
|
||||
parse_macro(
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
($ i:block) => { fn foo() $ i }
|
||||
}
|
||||
"#,
|
||||
)
|
||||
.assert_expand_statements("foo! { { 1; } }", "fn foo () {1 ;}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_meta() {
|
||||
parse_macro(
|
||||
|
Loading…
x
Reference in New Issue
Block a user