mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Add mbe lifetime split test
This commit is contained in:
parent
98819d8919
commit
ce674be217
1 changed files with 27 additions and 0 deletions
|
@ -214,6 +214,33 @@ SUBTREE $
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_lifetime_split() {
|
||||||
|
parse_macro(
|
||||||
|
r#"
|
||||||
|
macro_rules! foo {
|
||||||
|
($($t:tt)*) => { $($t)*}
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
)
|
||||||
|
.assert_expand(
|
||||||
|
r#"foo!(static bar: &'static str = "hello";);"#,
|
||||||
|
r#"
|
||||||
|
SUBTREE $
|
||||||
|
IDENT static 17
|
||||||
|
IDENT bar 18
|
||||||
|
PUNCH : [alone] 19
|
||||||
|
PUNCH & [alone] 20
|
||||||
|
PUNCH ' [joint] 21
|
||||||
|
IDENT static 22
|
||||||
|
IDENT str 23
|
||||||
|
PUNCH = [alone] 24
|
||||||
|
LITERAL "hello" 25
|
||||||
|
PUNCH ; [joint] 26
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_expr_order() {
|
fn test_expr_order() {
|
||||||
let expanded = parse_macro(
|
let expanded = parse_macro(
|
||||||
|
|
Loading…
Reference in a new issue