Merge pull request #18561 from markmurphydev/macro_name_raw_variable

Add macro expansion test for raw variable names
This commit is contained in:
Lukas Wirth 2024-12-02 16:23:07 +00:00 committed by GitHub
commit aa38be893c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -184,3 +184,31 @@ fn test() {
"#]], "#]],
); );
} }
#[test]
fn meta_variable_raw_name_equals_non_raw() {
check(
r#"
macro_rules! m {
($r#name:tt) => {
$name
}
}
fn test() {
m!(1234)
}
"#,
expect![[r#"
macro_rules! m {
($r#name:tt) => {
$name
}
}
fn test() {
1234
}
"#]],
);
}