Improve a test failure message.
authorCarl Hetherington <cth@carlh.net>
Fri, 2 Jun 2023 21:37:58 +0000 (23:37 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 2 Jun 2023 21:37:58 +0000 (23:37 +0200)
test/hints_test.cc

index 42c1c7cdaab7ac01008bbf2961b5c9d0a2b28fa5..55e859e0dce56ebffe5cd1ef8b1d1924c7629ce4 100644 (file)
@@ -84,7 +84,11 @@ check (TextType type, string name, optional<string> expected_hint = optional<str
                BOOST_REQUIRE_EQUAL (hints.size(), 1U);
                BOOST_CHECK_EQUAL (hints[0], *expected_hint);
        } else {
-               BOOST_CHECK (hints.empty());
+               string message;
+               for (auto hint: hints) {
+                       message += hint + "\n";
+               }
+               BOOST_CHECK_MESSAGE(hints.empty(), "Found: " << message);
        }
 }