1//===-- BreakpointIDTest.cpp ----------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "gtest/gtest.h"
10
11#include "lldb/Breakpoint/BreakpointID.h"
12#include "lldb/Utility/Status.h"
13
14#include "llvm/ADT/StringRef.h"
15
16using namespace lldb;
17using namespace lldb_private;
18
19TEST(BreakpointIDTest, StringIsBreakpointName) {
20 Status E;
21 EXPECT_FALSE(BreakpointID::StringIsBreakpointName("1breakpoint", E));
22 EXPECT_FALSE(BreakpointID::StringIsBreakpointName("-", E));
23 EXPECT_FALSE(BreakpointID::StringIsBreakpointName("", E));
24 EXPECT_FALSE(BreakpointID::StringIsBreakpointName("3.4", E));
25
26 EXPECT_TRUE(BreakpointID::StringIsBreakpointName("_", E));
27 EXPECT_TRUE(BreakpointID::StringIsBreakpointName("a123", E));
28 EXPECT_TRUE(BreakpointID::StringIsBreakpointName("test", E));
29}
30

source code of lldb/unittests/Breakpoint/BreakpointIDTest.cpp