C++Spec 1.1.0
BDD testing for C++
Loading...
Searching...
No Matches
be_less_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 BeLessThan : public MatcherBase<A, E> {
17 public:
18 BeLessThan(Expectation<A>& expectation, E expected) : MatcherBase<A, E>(expectation, expected) {}
19 bool match() override { return Util::less(this->actual(), this->expected()); }
20 bool negated_match() override { return Util::greater_equal(this->actual(), this->expected()); }
21 std::string verb() override { return "be less 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 less(const A &a, const B &b)
a < b, by value when both are integers (std::cmp_less, so a negative signed value is below any unsign...
Definition util.hpp:232
constexpr bool greater_equal(const A &a, const B &b)
a >= b, by value when both are integers (std::cmp_greater_equal), and with >= otherwise.
Definition util.hpp:268