21 template <
class Matcher>
23 static std::string verb() {
return "should"; }
28 template <
class Matcher>
30 static std::string verb() {
return "should not"; }
41template <
class Matcher>
45 matched = matcher.match();
46 }
catch (std::exception& e) {
47 return Result::error_with(matcher.get_location(), e.what());
49 return Result::error_with(matcher.get_location(),
"Unknown exception thrown during matcher execution.");
52 return !matched ? Result::failure_with(matcher.get_location(), matcher.failure_message())
53 : Result::success(matcher.get_location());
64template <
class Matcher>
68 matched = matcher.negated_match();
69 }
catch (std::exception& e) {
70 return Result::error_with(matcher.get_location(), e.what());
72 return Result::error_with(matcher.get_location(),
"Unhandled exception thrown during matcher execution.");
74 return !matched ? Result::failure_with(matcher.get_location(), matcher.failure_message_when_negated())
75 : Result::success(matcher.get_location());
Handles "negative" expectations (i.e. negated with '.not_()
Definition handler.hpp:27
static Result handle_matcher(Matcher &matcher)
runs a negative expectation
Definition handler.hpp:65
Handles "positive" expectations (i.e. non-negated)
Definition handler.hpp:20
static Result handle_matcher(Matcher &matcher)
runs a positive expectation
Definition handler.hpp:42