Further Exploration

You can now keep your macros well tested and well specified. Your testing skills will help you balance the complexity macros introduce with the payoff they provide in productivity and power. Apply the skills you’ve seen here, and don’t worry too much about the testing methodologies you should use. Well-tested code is the goal; just make sure you make it happen.

Next, we’ll create a full-featured domain-specific language. But first, try expanding your testing skills and have a little fun. Here are a couple of ideas to get you started.

  • Let’s get meta. Use your Assertion.assert macro to test your Translator and Loop macros. Instead of ExUnit, rewrite all the tests in this chapter to use our mini Assertion test framework. Our ...

Get Metaprogramming Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.