Macro proc_macro_utils::assert_tokens
source · macro_rules! assert_tokens { ($lhs:expr, { $($rhs:tt)* }) => { ... }; }
Expand description
Asserts that the lhs matches the tokens wrapped in braces on the rhs.
lhs needs to be an expression implementing IntoIterator<Item=TokenTree>
e.g. TokenStream or
TokenParser.
let some_tokens = quote! { ident, { group } };
assert_tokens! {some_tokens, { ident, {group} }};