================ @@ -0,0 +1,268 @@ +//===-- ProtocolTypesTest.cpp -----------------------------------*- C++ -*-===// +// +// 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 "Protocol/ProtocolTypes.h" +#include "gtest/gtest.h" + +using namespace llvm; +using namespace lldb; +using namespace lldb_dap; +using namespace lldb_dap::protocol; + +TEST(ProtocolTypesTest, ExceptionBreakpointsFilter) { + ExceptionBreakpointsFilter filter; + filter.filter = "testFilter"; + filter.label = "Test Filter"; + filter.description = "This is a test filter"; + filter.defaultState = true; + filter.supportsCondition = true; + filter.conditionDescription = "Condition for test filter"; + + llvm::json::Value value = toJSON(filter); + const json::Object *obj = value.getAsObject(); + ASSERT_NE(obj, nullptr); + + EXPECT_EQ(obj->getString("filter"), "testFilter"); + EXPECT_EQ(obj->getString("label"), "Test Filter"); + EXPECT_EQ(obj->getString("description"), "This is a test filter"); + EXPECT_EQ(obj->getBoolean("default"), true); + EXPECT_EQ(obj->getBoolean("supportsCondition"), true); + EXPECT_EQ(obj->getString("conditionDescription"), + "Condition for test filter"); ---------------- JDevlieghere wrote:
Alright, if that's the direction, let me start by landing the `Source` test and we can support the other types in a similar fashion as we add support for serialization. https://github.com/llvm/llvm-project/pull/139502 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits