Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 1.11 KB

File metadata and controls

37 lines (24 loc) · 1.11 KB

Testing Exceptions

Contents

Testing exception messages

Testing exceptions with Approval Tests is very easy. Simply pass in a call to the function (usually wrapped in a lambda). Approval tests will execute the code, catch the exception, and verify the exception's message, i.e. exception.what().

The exception thrown must inherit std::exception.

Approvals::verifyExceptionMessage([](){/* your code goes here */});

snippet source / anchor


Back to User Guide