now, the stringify is fine if my pattern is not a tuple (eg: Test1), however it will print the arguments if i call it with a tuple (eg: Test2(_)). Is there a way to get only the type out of a pat in a macro ? It would even be better if it doesn't print the path like: Test::Test1 and instead print onlyTest1.
I don't understand based on the description alone what you are looking for. Can you provide specific, demonstrative examples of what results you get and what results you want?
No, I don't think so. You can achieve this with a function-like procedural macro, though. They are much more powerful than declarative macros, allowing you to manipulate the input TokenStream, extracting the information you need with the syn crate.
I can recommend the little book of rust macros very much! It is a great source of knowledge about rust macros, declarative and procedural. There is a section on function-like procedural macros, hope that will help you.
Also, with the structure of your macro, you can't invoke Into<&str> on $to_be, because $to_be is a pattern, not a type. Unfortunately, if you provide $to_be as a type (ty) instead, your macro will fail. Some($to_be) won't work, because it expects a pattern.