mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
add test for macro expand formatting
This commit is contained in:
parent
ebf8b1a96e
commit
e34ae760f0
1 changed files with 18 additions and 0 deletions
|
@ -237,6 +237,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]
|
#[test]
|
||||||
fn macro_expand_recursive_expansion() {
|
fn macro_expand_recursive_expansion() {
|
||||||
check(
|
check(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue