mocks.cpp 673 B

123456789101112131415161718
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #include "toolchain/diagnostics/mocks.h"
  5. namespace Carbon {
  6. void PrintTo(const Diagnostic& diagnostic, std::ostream* os) {
  7. *os << "Diagnostic{"
  8. << (diagnostic.level == Diagnostic::Level::Error ? "Error" : "Warning")
  9. << ", " << diagnostic.location.file_name << ":"
  10. << diagnostic.location.line_number << ":"
  11. << diagnostic.location.column_number << ", "
  12. << diagnostic.short_name.str() << ", " << diagnostic.message << "}";
  13. }
  14. } // namespace Carbon