Xamarin Public Jenkins (auto-signing) 468663ddbb Imported Upstream version 6.10.0.49
Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
2020-01-16 16:38:04 +00:00

27 lines
555 B
C++

#include "gtest/gtest.h"
#include "lldb/Utility/JSON.h"
#include "lldb/Utility/StreamString.h"
using namespace lldb_private;
TEST(JSONTest, Dictionary) {
JSONObject o;
o.SetObject("key", std::make_shared<JSONString>("value"));
StreamString stream;
o.Write(stream);
ASSERT_EQ(stream.GetString(), R"({"key":"value"})");
}
TEST(JSONTest, Newlines) {
JSONObject o;
o.SetObject("key", std::make_shared<JSONString>("hello\nworld"));
StreamString stream;
o.Write(stream);
ASSERT_EQ(stream.GetString(), R"({"key":"hello\nworld"})");
}