Unnamed repository; edit this file 'description' to name the repository.
add test for macro expand formatting
andylizi 2022-05-24
parent ebf8b1a · commit e34ae76
-rw-r--r--crates/ide/src/expand_macro.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/crates/ide/src/expand_macro.rs b/crates/ide/src/expand_macro.rs
index 290f797c5e..a578aba01f 100644
--- a/crates/ide/src/expand_macro.rs
+++ b/crates/ide/src/expand_macro.rs
@@ -238,6 +238,24 @@ fn main() {
}
#[test]
+ fn macro_expand_underscore() {
+ check(
+ r#"
+macro_rules! bar {
+ ($i:tt) => { for _ in 0..$i {} }
+}
+fn main() {
+ ba$0r!(42);
+}
+"#,
+ expect![[r#"
+ bar
+ for _ in 0..42{}
+ "#]],
+ );
+ }
+
+ #[test]
fn macro_expand_recursive_expansion() {
check(
r#"