fix: improve whitespace insertion in pretty printer

This commit is contained in:
Ryo Yoshida 2022-06-28 20:40:22 +09:00
parent 9eaf96c9ea
commit 36d2b43dfd
No known key found for this signature in database
GPG key ID: E25698A930586171
2 changed files with 46 additions and 4 deletions

View file

@ -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(