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 | 46 |
1 files changed, 46 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 f1e979503e..7c9a19613b 100644 --- a/crates/hir_def/src/macro_expansion_tests/mbe.rs +++ b/crates/hir_def/src/macro_expansion_tests/mbe.rs @@ -261,3 +261,49 @@ fn baz() { "#]], ) } + +#[test] +fn test_expr_order() { + check( + r#" +macro_rules! m { + ($ i:expr) => { fn bar() { $ i * 3; } } +} +// +tree +m! { 1 + 2 } +"#, + expect![[r#" +macro_rules! m { + ($ i:expr) => { fn bar() { $ i * 3; } } +} +fn bar() { + 1+2*3; +} +// [email protected] "fn" +// [email protected] "bar" +// [email protected] "(" +// [email protected] ")" +// [email protected] "{" +// [email protected] "1" +// [email protected] "+" +// [email protected] "2" +// [email protected] "*" +// [email protected] "3" +// [email protected] ";" +// [email protected] "}" + +"#]], + ) +} |