O'Reilly logo

Metaprogramming Elixir by Chris McCord

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4How to Test Macros

Any good library is only as reliable as the test suite behind it. You’ve written your own language features and a couple of essential application libraries. You even saw how macros let you create an expressive test framework. What you haven’t seen yet is how to test macros themselves and the code generation they perform. We’re going explore how to test macros so you can confidently maintain your libraries. You’ll see few techniques for testing code generation and different test-case strategies for the types of metaprogramming involved.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required