mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
internal: add cloning macro fixture
Macro that deep clone the tokens but otherwise preserves source locations and hygiene info is an interesting case for IDE support. Lets have this, although we don't actively use it at the moment.
This commit is contained in:
parent
2ac1ffc0f3
commit
c27fdc75fa
2 changed files with 41 additions and 1 deletions
|
@ -42,6 +42,19 @@ fn test_fn_like_macro() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_fn_like_macro2() {
|
||||
assert_expand(
|
||||
"fn_like_clone_tokens",
|
||||
r#"ident, []"#,
|
||||
expect![[r#"
|
||||
SUBTREE $
|
||||
IDENT ident 4294967295
|
||||
PUNCH , [alone] 4294967295
|
||||
SUBTREE [] 4294967295"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_attr_macro() {
|
||||
// Corresponds to
|
||||
|
@ -70,6 +83,7 @@ fn list_test_macros() {
|
|||
fn_like_noop [FuncLike]
|
||||
fn_like_panic [FuncLike]
|
||||
fn_like_error [FuncLike]
|
||||
fn_like_clone_tokens [FuncLike]
|
||||
attr_noop [Attr]
|
||||
attr_panic [Attr]
|
||||
attr_error [Attr]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue