Add test for implicit format args support through nested macro call

This commit is contained in:
Lukas Wirth 2023-12-05 16:32:49 +01:00
parent fe0a85ca29
commit 4525787ed5

View file

@ -6673,3 +6673,28 @@ format_args!(r"{$0aaaaa}");
"#]], "#]],
); );
} }
#[test]
fn format_args_implicit_nested() {
check(
r#"
//- minicore: fmt
macro_rules! foo {
($($tt:tt)*) => {
format_args!($($tt)*)
}
}
fn test() {
let aaaaa = "foo";
foo!(r"{$0aaaaa}");
}
"#,
expect![[r#"
*aaaaa*
```rust
let aaaaa: &str // size = 16 (0x10), align = 8, niches = 1
```
"#]],
);
}