mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-29 16:09:30 +00:00

This enables us to avoid `catch_reporter_bases.hpp` being indirectly dependent on `catch_tostring.hpp`, cutting apart quite a bit indirect inclusions.
30 lines
877 B
C++
30 lines
877 B
C++
#include <catch2/internal/catch_lazy_expr.hpp>
|
|
|
|
#include <catch2/internal/catch_decomposer.hpp>
|
|
|
|
|
|
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;
|
|
}
|
|
|
|
} // namespace Catch
|