internal: add integrated test for token censoring

This commit is contained in:
Aleksey Kladov 2021-10-10 16:50:28 +03:00
parent a88344152d
commit 634f047d90
7 changed files with 105 additions and 71 deletions

View file

@ -270,6 +270,10 @@ fn test_proc_macros(proc_macros: &[String]) -> (Vec<ProcMacro>, String) {
pub fn identity(_attr: TokenStream, item: TokenStream) -> TokenStream {
item
}
#[proc_macro_derive(derive_identity)]
pub fn derive_identity(item: TokenStream) -> TokenStream {
item
}
#[proc_macro_attribute]
pub fn input_replace(attr: TokenStream, _item: TokenStream) -> TokenStream {
attr
@ -285,6 +289,11 @@ pub fn mirror(input: TokenStream) -> TokenStream {
kind: crate::ProcMacroKind::Attr,
expander: Arc::new(IdentityProcMacroExpander),
},
ProcMacro {
name: "derive_identity".into(),
kind: crate::ProcMacroKind::CustomDerive,
expander: Arc::new(IdentityProcMacroExpander),
},
ProcMacro {
name: "input_replace".into(),
kind: crate::ProcMacroKind::Attr,