C++Spec 1.1.0
BDD testing for C++
Loading...
Searching...
No Matches
be_greater_than.hpp
Go to the documentation of this file.
1
2#pragma once
3#include <string>
4
6#include "util.hpp"
7
8namespace CppSpec::Matchers {
9
15template <typename A, typename E>
16class BeGreaterThan : public MatcherBase<A, E> {
17 public:
18 BeGreaterThan(Expectation<A>& expectation, E expected) : MatcherBase<A, E>(expectation, expected) {}
19 bool match() override { return Util::greater(this->actual(), this->expected()); }
20 bool negated_match() override { return Util::less_equal(this->actual(), this->expected()); }
21 std::string verb() override { return "be greater than"; }
22};
23
24} // namespace CppSpec::Matchers
Wraps the target of an expectation.
Definition expectation.hpp:48
Definition have_error.hpp:9
Contains the base class for all Matchers.
Utility functions and classes.
constexpr bool greater(const A &a, const B &b)
a > b, by value when both are integers (std::cmp_greater), and with > otherwise.
Definition util.hpp:256
constexpr bool less_equal(const A &a, const B &b)
a <= b, by value when both are integers (std::cmp_less_equal), and with <= otherwise.
Definition util.hpp:244