5

Adding More Confirm Types

The previous chapter introduced confirmations and showed you how to use them to verify that the bool values within your tests match what you expect them to be. The chapter did this with some exploratory code based on a school grading example. We’re going to change the grading example to better fit with a test library and add additional types that you will be able to use in your confirms.

In this chapter, we will cover the following main topics:

  • Fixing the bool confirms
  • Confirming equality
  • Changing the code to fix a problem that line numbers are causing with test failures
  • Adding more confirm types
  • Confirming string literals
  • Confirming floating-point values
  • How to write confirms

The additional types add some new twists ...

Get Test-Driven Development with C++ 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.