C++Spec 1.1.0
BDD testing for C++
Loading...
Searching...
No Matches
matcher_base.hpp File Reference

Contains the base class for all Matchers. More...

#include <source_location>
#include <string>
#include <string_view>
#include "expectations/handler.hpp"
#include "it_base.hpp"
#include "pretty_matchers.hpp"
Include dependency graph for matcher_base.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CppSpec::Matchers::MatcherBase< Actual, Expected >
 the base class for all Matcher classes and objects More...

Functions

template<typename A>
std::string CppSpec::Matchers::no_text_to_search (const A &actual)
 The line a matcher that searches text puts below its own message when the actual value is a null C string, which has no text to search, so the matcher fails it negated as well as positive.
template<typename E>
std::string CppSpec::Matchers::no_text_to_look_for (const E &expected)
 The line nothing_to_look_for when the expected value is a null C string.

Variables

constexpr std::string_view CppSpec::Matchers::nothing_to_look_for = "\nnullptr is not text, so there is nothing to look for"
 The line a matcher that searches text puts below its own message when the text or pattern it looks for is a null C string, which is nothing to look for, so the matcher fails it negated as well as positive.

Detailed Description

Contains the base class for all Matchers.

Copyright 2016 Katherine Whitlock

Author
Katherine Whitlock (toroidalcode)

Function Documentation

◆ no_text_to_look_for()

template<typename E>
std::string CppSpec::Matchers::no_text_to_look_for ( const E & expected)
nodiscard

The line nothing_to_look_for when the expected value is a null C string.

Parameters
expectedthe expected value
Returns
the line, led by a newline, or an empty string when the expected value is not a null C string

◆ no_text_to_search()

template<typename A>
std::string CppSpec::Matchers::no_text_to_search ( const A & actual)
nodiscard

The line a matcher that searches text puts below its own message when the actual value is a null C string, which has no text to search, so the matcher fails it negated as well as positive.

Parameters
actualthe actual value
Returns
the line, led by a newline, or an empty string when the actual value is text