From 8de4cf7e759c55a89761c25900d80e01ae7ac3fd Mon Sep 17 00:00:00 2001 From: Menno Fraters Date: Sat, 5 Mar 2022 23:14:35 +0000 Subject: Add contains option to checks. (#620) * Add contains otion to checks. * Add test for teh contains option of CHECK_THROWS_WITH. * Adress comments Saalvage: move compare function to Contains, add operator== and make m_exception_string a union." * Add new tests. * Attempt to fix windows specific warning about unions. * Attempt 2 to fix windows specific warning about unions. * Attempt 3 to fix windows specific warning about unions. * Attempt 4 to fix windows specific warning about unions. * Return union to a struct. * Fixing and refactoring * Docs Co-authored-by: Salvage <29021710+Saalvage@users.noreply.github.com> --- examples/all_features/stringification.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'examples/all_features/stringification.cpp') diff --git a/examples/all_features/stringification.cpp b/examples/all_features/stringification.cpp index adca1e7f..2add560d 100644 --- a/examples/all_features/stringification.cpp +++ b/examples/all_features/stringification.cpp @@ -151,6 +151,8 @@ TEST_CASE("all asserts should fail and show how the objects get stringified") { CHECK(doctest::IsNaN(std::numeric_limits::infinity())); // can't test actual nan because it's implementation defined + CHECK("a" == doctest::Contains("aaa")); + // lets see if this exception gets translated throw_if(true, bla1); } -- cgit v1.2.3