aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-04-18 19:57:14 +0100
committerGitHub <[email protected]>2020-04-18 19:57:14 +0100
commitb949500126f6bd3723d22541adb2f7c8aae206a4 (patch)
tree95976b0a965dc1f5e9a798cf64f4805deea684fb
parent9b16ae5149b7b01c8b2ec4bfb87182c993997b44 (diff)
parentce674be2176e14e0d57c3a3e9edc315304aa2fde (diff)
Merge #4032
4032: Add mbe lifetime split test r=matklad a=edwin0cheng Co-authored-by: Edwin Cheng <[email protected]>
-rw-r--r--crates/ra_mbe/src/tests.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/crates/ra_mbe/src/tests.rs b/crates/ra_mbe/src/tests.rs
index 5d1274d21..f2a726538 100644
--- a/crates/ra_mbe/src/tests.rs
+++ b/crates/ra_mbe/src/tests.rs
@@ -215,6 +215,33 @@ SUBTREE $
215} 215}
216 216
217#[test] 217#[test]
218fn test_lifetime_split() {
219 parse_macro(
220 r#"
221macro_rules! foo {
222 ($($t:tt)*) => { $($t)*}
223}
224"#,
225 )
226 .assert_expand(
227 r#"foo!(static bar: &'static str = "hello";);"#,
228 r#"
229SUBTREE $
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
244#[test]
218fn test_expr_order() { 245fn test_expr_order() {
219 let expanded = parse_macro( 246 let expanded = parse_macro(
220 r#" 247 r#"