Skip to content

Commit e34ae76

Browse files
committed
add test for macro expand formatting
1 parent ebf8b1a commit e34ae76

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

crates/ide/src/expand_macro.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,24 @@ fn main() {
237237
);
238238
}
239239

240+
#[test]
241+
fn macro_expand_underscore() {
242+
check(
243+
r#"
244+
macro_rules! bar {
245+
($i:tt) => { for _ in 0..$i {} }
246+
}
247+
fn main() {
248+
ba$0r!(42);
249+
}
250+
"#,
251+
expect![[r#"
252+
bar
253+
for _ in 0..42{}
254+
"#]],
255+
);
256+
}
257+
240258
#[test]
241259
fn macro_expand_recursive_expansion() {
242260
check(

0 commit comments

Comments
 (0)