1 //===-- BreakpointIDTest.cpp ------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "gtest/gtest.h" 11 12 #include "lldb/Breakpoint/BreakpointID.h" 13 #include "lldb/Core/Error.h" 14 15 #include "llvm/ADT/StringRef.h" 16 17 using namespace lldb; 18 using namespace lldb_private; 19 20 TEST(BreakpointIDTest, StringIsBreakpointName) { 21 Error E; 22 EXPECT_FALSE(BreakpointID::StringIsBreakpointName("1breakpoint", E)); 23 EXPECT_FALSE(BreakpointID::StringIsBreakpointName("-", E)); 24 EXPECT_FALSE(BreakpointID::StringIsBreakpointName("", E)); 25 EXPECT_FALSE(BreakpointID::StringIsBreakpointName("3.4", E)); 26 27 EXPECT_TRUE(BreakpointID::StringIsBreakpointName("_", E)); 28 EXPECT_TRUE(BreakpointID::StringIsBreakpointName("a123", E)); 29 EXPECT_TRUE(BreakpointID::StringIsBreakpointName("test", E)); 30 } 31