This test was adapted from proc-macro-hack repository, specifically demo-hack and demo-hack-impl directories. All the credits due to the corresponding authors, @dtolnay in particular.
proc-macro-hack
demo-hack
demo-hack-impl
@dtolnay