/ externals / catch / src / catch2 / internal / catch_decomposer.cpp
catch_decomposer.cpp
 1  
 2  //              Copyright Catch2 Authors
 3  // Distributed under the Boost Software License, Version 1.0.
 4  //   (See accompanying file LICENSE.txt or copy at
 5  //        https://www.boost.org/LICENSE_1_0.txt)
 6  
 7  // SPDX-License-Identifier: BSL-1.0
 8  
 9  #include <catch2/internal/catch_decomposer.hpp>
10  
11  namespace Catch {
12  
13      ITransientExpression::~ITransientExpression() = default;
14  
15      void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs ) {
16          if( lhs.size() + rhs.size() < 40 &&
17                  lhs.find('\n') == std::string::npos &&
18                  rhs.find('\n') == std::string::npos )
19              os << lhs << ' ' << op << ' ' << rhs;
20          else
21              os << lhs << '\n' << op << '\n' << rhs;
22      }
23  }