summaryrefslogtreecommitdiff
path: root/vendor/bandit/bandit/assertion_frameworks/matchers/BeFalsy.h
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/bandit/bandit/assertion_frameworks/matchers/BeFalsy.h')
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/matchers/BeFalsy.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/vendor/bandit/bandit/assertion_frameworks/matchers/BeFalsy.h b/vendor/bandit/bandit/assertion_frameworks/matchers/BeFalsy.h
new file mode 100644
index 00000000..718c6366
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/matchers/BeFalsy.h
@@ -0,0 +1,39 @@
+#ifndef BANDIT_BEFALSY_H
+#define BANDIT_BEFALSY_H
+
+#include "Matcher.h"
+
+namespace bandit { namespace Matchers {
+
+ class BeFalsy : public Matcher
+ {
+ private:
+ // BeFalsy& operator=(const BeFalsy&);
+
+ public:
+ explicit BeFalsy() : Matcher() {}
+ // ~BeFalsy() {}
+
+ template<typename U>
+ bool matches(const U& actualValue) const
+ {
+ return !actualValue;
+ }
+
+ bool matches(const std::nullptr_t&) const
+ {
+ return true;
+ }
+
+
+ protected:
+ virtual std::string failure_message_end() const
+ {
+ return std::string("evaluate to false");
+ }
+ };
+
+ static const BeFalsy be_falsy = BeFalsy();
+}}
+
+#endif // BANDIT_BEFALSY_H