6namespace CppSpec::Matchers {
10 { t.has_value() } -> std::same_as<bool>;
14class HaveValue :
public MatcherBase<T, void*> {
16 HaveValue(
Expectation<T>& expectation) : MatcherBase<T, void*>(expectation) {}
18 std::string verb()
override {
return "have"; }
21 bool match()
override {
return (this->actual().has_value()); }
24template <optional T,
typename E>
25class HaveValueEqualTo :
public Equal<T, E> {
27 static_assert(std::is_same_v<typename T::value_type, E>,
"the contained value_type must match the expected type");
30 bool match() {
return (this->actual().value() == this->expected()); }
Wraps the target of an expectation.
Definition expectation.hpp:47
std::string description() override
Get the description of the Matcher.
Definition have_value.hpp:19
Definition have_error.hpp:9
Definition have_value.hpp:9
Contains the base class for all Matchers.