Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_def/src/macro_expansion_tests/mbe.rs')
| -rw-r--r-- | crates/hir_def/src/macro_expansion_tests/mbe.rs | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/crates/hir_def/src/macro_expansion_tests/mbe.rs b/crates/hir_def/src/macro_expansion_tests/mbe.rs index 993c7d99b7..eaf04ec6c2 100644 --- a/crates/hir_def/src/macro_expansion_tests/mbe.rs +++ b/crates/hir_def/src/macro_expansion_tests/mbe.rs @@ -415,3 +415,63 @@ x![(a b)]; "#]], ) } + +#[test] +fn test_expand_to_item_list() { + check( + r#" +macro_rules! structs { + ($($i:ident),*) => { $(struct $i { field: u32 } )* } +} + +// +tree +structs!(Foo, Bar); + "#, + expect![[r#" +macro_rules! structs { + ($($i:ident),*) => { $(struct $i { field: u32 } )* } +} + +struct Foo { + field:u32 +} +struct Bar { + field:u32 +} +// [email protected] "struct" +// [email protected] "Foo" +// [email protected] "{" +// [email protected] "field" +// [email protected] ":" +// [email protected] "u32" +// [email protected] "}" +// [email protected] "struct" +// [email protected] "Bar" +// [email protected] "{" +// [email protected] "field" +// [email protected] ":" +// [email protected] "u32" +// [email protected] "}" + + "#]], + ); +} |