summaryrefslogtreecommitdiff
path: root/vendor/bandit/bandit/assertion_frameworks/matchers/BeGTE.h
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/bandit/bandit/assertion_frameworks/matchers/BeGTE.h')
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/matchers/BeGTE.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/vendor/bandit/bandit/assertion_frameworks/matchers/BeGTE.h b/vendor/bandit/bandit/assertion_frameworks/matchers/BeGTE.h
new file mode 100644
index 00000000..072b2caf
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/matchers/BeGTE.h
@@ -0,0 +1,45 @@
+#ifndef BANDIT_BEGREATERTHANOREQUAL_H
+#define BANDIT_BEGREATERTHANOREQUAL_H
+
+#include "Matcher.h"
+
+namespace bandit { namespace Matchers {
+
+ template<typename T>
+ class BeGTE : public Matcher
+ {
+ public:
+ explicit BeGTE(const T& expectedValue) : Matcher(), _expectedValue(expectedValue) {}
+
+ template<typename U>
+ bool matches(const U& actualValue) const
+ {
+ return actualValue >= _expectedValue;
+ }
+
+ protected:
+ virtual std::string failure_message_end() const
+ {
+ std::ostringstream ss;
+ ss << "be greater than or equal to <" << _expectedValue << ">";
+ return ss.str();
+ }
+
+ private:
+ const T& _expectedValue;
+ };
+
+ template<typename T>
+ BeGTE<T> be_gte(const T& expectedValue)
+ {
+ return BeGTE<T>(expectedValue);
+ }
+
+ template<typename T>
+ BeGTE<T> be_greater_than_or_equal_to(const T& expectedValue)
+ {
+ return be_gte(expectedValue);
+ }
+}}
+
+#endif // BANDIT_BEGREATERTHANOREQUAL_H