Setting Up Your Test Suite

Learn to test macros to maintain our libraries by using different test-case strategies.

We'll cover the following

The test suite

Any good library is only as reliable as the test suite behind it. We’ve written our own language features and a couple of essential application libraries in the previous chapters. We even saw how macros let us create an expressive test framework. What we haven’t learned yet is how to test macros themselves and the code generation they perform.

In this lesson, we’ll explore how to test macros so that we can confidently maintain our libraries. We’ll see a few techniques for testing code generation and different test-case strategies for the types of metaprogramming involved.

Get hands-on with 1200+ tech skills courses.