Skip to content

Commit b949500

Browse files
Merge #4032
4032: Add mbe lifetime split test r=matklad a=edwin0cheng Co-authored-by: Edwin Cheng <[email protected]>
2 parents 9b16ae5 + ce674be commit b949500

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

crates/ra_mbe/src/tests.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,33 @@ SUBTREE $
214214
);
215215
}
216216

217+
#[test]
218+
fn test_lifetime_split() {
219+
parse_macro(
220+
r#"
221+
macro_rules! foo {
222+
($($t:tt)*) => { $($t)*}
223+
}
224+
"#,
225+
)
226+
.assert_expand(
227+
r#"foo!(static bar: &'static str = "hello";);"#,
228+
r#"
229+
SUBTREE $
230+
IDENT static 17
231+
IDENT bar 18
232+
PUNCH : [alone] 19
233+
PUNCH & [alone] 20
234+
PUNCH ' [joint] 21
235+
IDENT static 22
236+
IDENT str 23
237+
PUNCH = [alone] 24
238+
LITERAL "hello" 25
239+
PUNCH ; [joint] 26
240+
"#,
241+
);
242+
}
243+
217244
#[test]
218245
fn test_expr_order() {
219246
let expanded = parse_macro(

0 commit comments

Comments
 (0)