8namespace CppSpec::Matchers {
20class Satisfy :
public MatcherBase<A, bool>
22 std::function<bool(A)> test;
25 Satisfy(
Expectation<A>& expectation, std::function<
bool(A)> test) : MatcherBase<A, bool>(expectation), test(test) {}
29 std::string verb()
override {
return "be"; }
31 bool match()
override;
36 return std::format(
"expected {} to evaluate to true", MatcherBase<A, bool>::actual());
41 return std::format(
"expected {} to evaluate to false", MatcherBase<A, bool>::actual());
45bool Satisfy<A>::match() {
46 return test(this->actual());
Wraps the target of an expectation.
Definition expectation.hpp:47
std::string failure_message() override
Get message to give on match failure.
Definition satisfy.hpp:35
std::string failure_message_when_negated() override
Get message to give on match failure when negated.
Definition satisfy.hpp:40
Contains the base class for all Matchers.