Adding Tests to a Project
In this chapter, we’re going to add a major new ability to the test library. The new ability will let you check conditions within a test to make sure everything is going as planned. Sometimes, these checks are called an assert, and sometimes, they are called an expect. Whatever they are called, they let you confirm that the values you get back from the code being tested match expectations.
For this book and the test library that we’re creating, I’m going to call these checks confirmations. Each confirmation will be called a confirm. The reason for this is that assert is already being used in C++, and it can be confusing to use the same name. Additionally, expect is a common term within other test libraries, which is not by itself a reason to avoid using the same term. I actually like the term expect. But expect has another common behavior that we don’t want. Many other testing libraries will let a test continue even if an expect...