4032: Add mbe lifetime split test r=matklad a=edwin0cheng



Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
This commit is contained in:
bors[bot] 2020-04-18 18:57:14 +00:00 committed by GitHub
commit b949500126
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -214,6 +214,33 @@ fn from(it: $v) -> $e {
);
}
#[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]
fn test_expr_order() {
let expanded = parse_macro(