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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user