What are the best practices for unit testing compicated macros that use gensym
, preferably with Base.Test
? Since gensym
always returns different results, I cannot simply test for expression equality.
Is there a way to “reset” the global gensym
counter, similarly to srand
for random numbers? Or should I use some other trick?
All the libraries I looked at that use macros heavily rely on testing the application of the macro, which is a bit indirect, so I could not find an example.