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:
Aleksey Kladov 2021-06-25 10:32:13 +03:00
parent 2ac1ffc0f3
commit c27fdc75fa
2 changed files with 41 additions and 1 deletions

View file

@ -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]