//===-- StringPrinterTests.cpp --------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "lldb/DataFormatters/StringPrinter.h" #include "lldb/Utility/DataExtractor.h" #include "lldb/Utility/Endian.h" #include "lldb/Utility/StreamString.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/raw_ostream.h" #include "gtest/gtest.h" #include <optional> #include <string> usingnamespacelldb; usingnamespacelldb_private; StringPrinter; StringRef; #define QUOTE(x) … /// Format \p input according to the specified string encoding and special char /// escape style. template <StringPrinter::StringElementType elem_ty> static std::optional<std::string> format(StringRef input, StringPrinter::EscapeStyle escape_style) { … } // Test ASCII formatting for C++. This behaves exactly like UTF8 formatting for // C++, although that's questionable (see FIXME in StringPrinter.cpp). TEST(StringPrinterTests, CxxASCII) { … } // Test UTF8 formatting for C++. TEST(StringPrinterTests, CxxUTF8) { … } // Test UTF8 formatting for Swift. TEST(StringPrinterTests, SwiftUTF8) { … }