Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
ExpectString Class Reference

#include "lib/test/test-helper.hpp"

Description

Helper to produce better diagnostic messages when comparing to an expected result string.

This type can be used to mark a std::string in order to invoke a special rigged equality test. The counterpart for equality conversion can be any arbitrary type, on which some kind of string conversion can be performed

See also
format-obj.hpp
Examples
/Werk/devel/lumi/src/lib/test/test-helper.hpp.

Definition at line 328 of file test-helper.hpp.

Public Member Functions

 ExpectString (std::string &&s)
 
 ExpectString (std::string const &s)
 
bool verify (std::string const &actual) const
 

Friends

template<typename X >
bool operator== (X const &x, ExpectString const &expected)
 
template<typename X >
bool operator== (ExpectString const &expected, X const &x)
 
ExpectString operator+ (std::string &&l, ExpectString &&r)
 

Constructor & Destructor Documentation

◆ ExpectString() [1/2]

ExpectString ( std::string &&  s)
inline

Definition at line 334 of file test-helper.hpp.

◆ ExpectString() [2/2]

ExpectString ( std::string const &  s)
inline

Definition at line 335 of file test-helper.hpp.

Member Function Documentation

◆ verify()

bool verify ( std::string const &  actual) const

check equality and print difference

Remarks
defined here to avoid inclusion of <iostream> in header
Examples
/Werk/devel/lumi/src/lib/test/test-helper.hpp.

Definition at line 80 of file test-helper.cpp.

Friends And Related Symbol Documentation

◆ operator== [1/2]

template<typename X >
bool operator== ( X const &  x,
ExpectString const &  expected 
)
friend

◆ operator== [2/2]

template<typename X >
bool operator== ( ExpectString const &  expected,
X const &  x 
)
friend

Definition at line 348 of file test-helper.hpp.

◆ operator+

ExpectString operator+ ( std::string &&  l,
ExpectString &&  r 
)
friend
+ Inheritance diagram for ExpectString:
+ Collaboration diagram for ExpectString:

The documentation for this class was generated from the following files: