summaryrefslogtreecommitdiff
path: root/vendor/bandit/bandit/assertion_frameworks/matchers/BeFalsy.h
blob: 718c63669fb80a90945ec76da7d002fefd781b50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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