| 1894 | } |
| 1895 | |
| 1896 | virtual void reconstructExpression( std::string& dest ) const CATCH_OVERRIDE { |
| 1897 | std::string lhs = Catch::toString( m_lhs ); |
| 1898 | std::string rhs = Catch::toString( m_rhs ); |
| 1899 | char delim = lhs.size() + rhs.size() < 40 && |
| 1900 | lhs.find('\n') == std::string::npos && |
| 1901 | rhs.find('\n') == std::string::npos ? ' ' : '\n'; |
| 1902 | dest.reserve( 7 + lhs.size() + rhs.size() ); |
| 1903 | // 2 for spaces around operator |
| 1904 | // 2 for operator |
| 1905 | // 2 for parentheses (conditionally added later) |
| 1906 | // 1 for negation (conditionally added later) |
| 1907 | dest = lhs; |
| 1908 | dest += delim; |
| 1909 | dest += Internal::OperatorTraits<Op>::getName(); |
| 1910 | dest += delim; |
| 1911 | dest += rhs; |
| 1912 | } |
| 1913 | |
| 1914 | private: |
| 1915 | ResultBuilder& m_rb; |