mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Fixed whitespace bug
This commit is contained in:
parent
028595548b
commit
6794d50a9b
2 changed files with 35 additions and 3 deletions
|
@ -838,6 +838,37 @@ fn test_tt_composite() {
|
|||
.assert_expand_items(r#"foo! { => }"#, r#"0"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_tt_composite2() {
|
||||
let node = parse_macro(
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
($($tt:tt)*) => { abs!(=> $($tt)*) }
|
||||
}
|
||||
"#,
|
||||
)
|
||||
.expand_items(r#"foo!{#}"#);
|
||||
|
||||
let res = format!("{:#?}", &node);
|
||||
assert_eq_text!(
|
||||
res.trim(),
|
||||
r###"MACRO_ITEMS@[0; 10)
|
||||
MACRO_CALL@[0; 10)
|
||||
PATH@[0; 3)
|
||||
PATH_SEGMENT@[0; 3)
|
||||
NAME_REF@[0; 3)
|
||||
IDENT@[0; 3) "abs"
|
||||
EXCL@[3; 4) "!"
|
||||
TOKEN_TREE@[4; 10)
|
||||
L_PAREN@[4; 5) "("
|
||||
EQ@[5; 6) "="
|
||||
R_ANGLE@[6; 7) ">"
|
||||
WHITESPACE@[7; 8) " "
|
||||
POUND@[8; 9) "#"
|
||||
R_PAREN@[9; 10) ")""###
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_lifetime() {
|
||||
parse_macro(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue