add test for macro expand formatting

This commit is contained in:
andylizi 2022-05-24 12:45:58 +08:00
parent ebf8b1a96e
commit e34ae760f0
No known key found for this signature in database
GPG Key ID: BFBFA8C85929F0E8

View File

@ -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]
fn macro_expand_recursive_expansion() {
check(