6namespace CppSpec::Matchers {
8template <
class A,
class Ex>
9class Throw :
public MatcherBase<A, void*> {
11 explicit Throw(
Expectation<A>& expectation) : MatcherBase<A, void*>(expectation,
nullptr) {}
12 bool match()
override;
13 std::string verb()
override {
return "throw"; }
19template <
class A,
class Ex>
20bool Throw<A, Ex>::match() {
30template <
typename A,
typename Ex>
35template <
typename A,
typename Ex>
37 return std::format(
"expected the given function ([] -> {} {{...}}) to {}",
Util::demangle(
typeid(A).name()),
41template <
typename A,
typename Ex>
43 return std::format(
"expected the given function ([] -> {} {{...}}) not to {}",
Util::demangle(
typeid(A).name()),
Wraps the target of an expectation.
Definition expectation.hpp:47
std::string failure_message() override
Get message to give on match failure.
Definition throw.hpp:36
std::string failure_message_when_negated() override
Get message to give on match failure when negated.
Definition throw.hpp:42
std::string description() override
Get the description of the Matcher.
Definition throw.hpp:31
Contains the base class for all Matchers.
Utility functions and classes.
std::string demangle(const char *name)
Definition util.hpp:38