mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
fix: improve whitespace insertion in pretty printer
This commit is contained in:
parent
9eaf96c9ea
commit
36d2b43dfd
2 changed files with 46 additions and 4 deletions
|
@ -360,6 +360,38 @@ fn main() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn macro_expand_inner_macro_rules() {
|
||||
check(
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
($t:tt) => {{
|
||||
macro_rules! bar {
|
||||
() => {
|
||||
$t
|
||||
}
|
||||
}
|
||||
bar!()
|
||||
}};
|
||||
}
|
||||
|
||||
fn main() {
|
||||
foo$0!(42);
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
foo
|
||||
{
|
||||
macro_rules! bar {
|
||||
() => {
|
||||
42
|
||||
}
|
||||
}
|
||||
42
|
||||
}"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn macro_expand_inner_macro_fail_to_expand() {
|
||||
check(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue