C++Spec 1.1.0
BDD testing for C++
Loading...
Searching...
No Matches
pretty_matchers.hpp File Reference
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <deque>
#include <format>
#include <forward_list>
#include <list>
#include <map>
#include <memory>
#include <optional>
#include <ranges>
#include <regex>
#include <set>
#include <span>
#include <string>
#include <string_view>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include "prettyprint.hpp"
#include "util.hpp"
Include dependency graph for pretty_matchers.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pretty_print::is_container< std::optional< T > >
struct  CppSpec::Util::prints_through_pretty< T >
 Whether T prints differently through Pretty than through operator<<, so a container holding it is printed element by element through Pretty. More...
struct  CppSpec::Util::prints_through_pretty< std::optional< T > >
struct  CppSpec::Util::prints_through_pretty< std::pair< A, B > >
struct  CppSpec::Util::prints_through_pretty< std::tuple< Ts... > >
struct  CppSpec::Util::prints_through_pretty< R >
class  CppSpec::Pretty
 A helper base class that assists in pretty-printing various objects. More...

Concepts

concept  CppSpec::Util::is_std_container_like
 Checks whether T is a standard container, a std::span, a std::pair, a std::tuple or a built-in array: a type whose operator<< is cxx-prettyprint's, so Pretty may print it element by element in its place.
concept  CppSpec::Util::prints_elements_through_pretty
 Checks whether T is a container, pair or tuple that Pretty prints element by element, because an element prints differently through Pretty than through operator<<.

Functions

template<>
std::string CppSpec::Pretty::to_word< std::true_type > (const std::true_type &)
template<>
std::string CppSpec::Pretty::to_word< std::false_type > (const std::false_type &)
template<>
std::string CppSpec::Pretty::inspect_object< std::string > (const std::string &o)
 Specialization for C++ STL strings.
template<>
std::string CppSpec::Pretty::inspect_object< std::string_view > (const std::string_view &o)

Variables

template<typename T, template< typename... > class Template>
constexpr bool CppSpec::Util::is_specialization_of = false
template<template< typename... > class Template, typename... Args>
constexpr bool CppSpec::Util::is_specialization_of< Template< Args... >, Template > = true
template<typename T>
constexpr bool CppSpec::Util::is_std_array = false
template<typename T, std::size_t N>
constexpr bool CppSpec::Util::is_std_array< std::array< T, N > > = true
template<typename T>
constexpr bool CppSpec::Util::is_std_span = false
template<typename T, std::size_t Extent>
constexpr bool CppSpec::Util::is_std_span< std::span< T, Extent > > = true

Function Documentation

◆ Pretty::inspect_object< std::string >()

template<>
std::string CppSpec::Pretty::inspect_object< std::string > ( const std::string & o)
inline

Specialization for C++ STL strings.

Parameters
othe input string
Returns
the generated string