Summary
This chapter explored ways in which to improve the test library by making use of a new feature in C++ 20 to get line numbers from the standard library instead of from the preprocessor. Even though the new code doesn’t work right now, it will eventually make the CONFIRM_TRUE
, CONFIRM_FALSE
, and CONFIRM
macros optional. You will no longer have to use the macros. But I still like to use them because they help wrap up code that is easy to get wrong. And the macros are easier to spot in the tests because they use all capital letters.
We also explored a trend to avoid macros when declaring tests and what it would look like if we used lambdas instead. The approach almost worked with a more complicated test declaration. The extra complexity doesn’t matter though because the design did not work for all the tests.
It is still valuable for you to read about the proposed changes. You can learn about how other test libraries might work and understand why this book explains...