From 7b9f4e4e8169ca2fad3a1c7ca03f07ecfc46678e Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Sat, 1 Aug 2015 16:35:25 +0200 Subject: Bandit 2.0.0 --- .../bandit/assertion_frameworks/matchers/BeFalsy.h | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 vendor/bandit/bandit/assertion_frameworks/matchers/BeFalsy.h (limited to 'vendor/bandit/bandit/assertion_frameworks/matchers/BeFalsy.h') 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 + 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 -- cgit v1.2.3