catch_decomposer.cpp 807 B

123456789101112131415161718192021222324
  1. /*
  2. * Created by Phil Nash on 8/8/2017.
  3. * Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
  4. *
  5. * Distributed under the Boost Software License, Version 1.0. (See accompanying
  6. * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. */
  8. #include "catch_decomposer.h"
  9. #include "catch_config.hpp"
  10. namespace Catch {
  11. ITransientExpression::~ITransientExpression() = default;
  12. void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs ) {
  13. if( lhs.size() + rhs.size() < 40 &&
  14. lhs.find('\n') == std::string::npos &&
  15. rhs.find('\n') == std::string::npos )
  16. os << lhs << " " << op << " " << rhs;
  17. else
  18. os << lhs << "\n" << op << "\n" << rhs;
  19. }
  20. }