Creating an enum iterator using Macros 1.1

Yesterday I was thinking about some testing strategies for a little project Iā€™m working on. One idea I had was to test the output of a function when applied to every possible variant of an enum. One way I could implement this is by manually naming every variant of the enum in question ā€“ probably while using a macro. However, I am terrible at keeping track of things and I would most likely add a new variant to my enum without updating my tests. I could include in the macro a line of code that matched each variant like this:

Read More