You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
REQUIRE_THROWS_MESSAGE only checks if an exception was thrown, and doesn't check if the exception had the expected message.
[EDIT] I understand that the macro doesn't do what I thought. There doesn't seem to be documentation on it, and the name is IMO misleading. I would except that the message has to match the exception's what(). Is there a macro like this in doctest?
Steps to reproduce
TEST_CASE("REQUIRE_THROWS_MESSAGE")
{
SUBCASE("Checks whether the message is correct")
{
auto throwException = [] {
throwstd::runtime_error("Some Message");
};
// This passesREQUIRE_THROWS_MESSAGE(throwException(), "Something else");
}
}
Extra information
doctest version: 2.0.0
Operating System: macOS 10.13.6
Compiler+version: Xcode 9.4.1
The text was updated successfully, but these errors were encountered:
Description
REQUIRE_THROWS_MESSAGE
only checks if an exception was thrown, and doesn't check if the exception had the expected message.[EDIT] I understand that the macro doesn't do what I thought. There doesn't seem to be documentation on it, and the name is IMO misleading. I would except that the message has to match the exception's
what()
. Is there a macro like this in doctest?Steps to reproduce
Extra information
The text was updated successfully, but these errors were encountered: