mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-25 05:59:24 +00:00
Split out LazyExpr into its own header
This enables us to avoid `catch_reporter_bases.hpp` being indirectly dependent on `catch_tostring.hpp`, cutting apart quite a bit indirect inclusions.
This commit is contained in:
parent
824ffe6525
commit
27f1756d8e
10 changed files with 72 additions and 45 deletions
|
@ -19,29 +19,6 @@
|
|||
|
||||
namespace Catch {
|
||||
|
||||
namespace {
|
||||
auto operator <<( std::ostream& os, ITransientExpression const& expr ) -> std::ostream& {
|
||||
expr.streamReconstructedExpression( os );
|
||||
return os;
|
||||
}
|
||||
}
|
||||
|
||||
auto operator << ( std::ostream& os, LazyExpression const& lazyExpr ) -> std::ostream& {
|
||||
if( lazyExpr.m_isNegated )
|
||||
os << "!";
|
||||
|
||||
if( lazyExpr ) {
|
||||
if( lazyExpr.m_isNegated && lazyExpr.m_transientExpression->isBinaryExpression() )
|
||||
os << "(" << *lazyExpr.m_transientExpression << ")";
|
||||
else
|
||||
os << *lazyExpr.m_transientExpression;
|
||||
}
|
||||
else {
|
||||
os << "{** error - unchecked empty expression requested **}";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
AssertionHandler::AssertionHandler
|
||||
( StringRef const& macroName,
|
||||
SourceLineInfo const& lineInfo,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue