blob: cdcf3236cd7742b2ae83d6fa2d982bc3035b3726 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
//===-- StructuredDataTest.cpp ----------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "gtest/gtest.h"
#include "lldb/Core/StructuredData.h"
#include "lldb/Utility/StreamString.h"
#include "llvm/BinaryFormat/MachO.h"
using namespace lldb;
using namespace lldb_private;
TEST(StructuredDataTest, StringDump) {
std::pair<llvm::StringRef, llvm::StringRef> TestCases[] = {
{ R"(asdfg)", R"("asdfg")" },
{ R"(as"df)", R"("as\"df")" },
{ R"(as\df)", R"("as\\df")" },
};
for(auto P : TestCases) {
StreamString S;
const bool pretty_print = false;
StructuredData::String(P.first).Dump(S, pretty_print);
EXPECT_EQ(P.second, S.GetString());
}
}
|