| 1 | //===-- DumpSymbolTests.cpp -------------------------------------*- C++ -*-===// |
| 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 "TweakTesting.h" |
| 10 | #include "gmock/gmock.h" |
| 11 | #include "gtest/gtest.h" |
| 12 | #include <string> |
| 13 | |
| 14 | using ::testing::AllOf; |
| 15 | using ::testing::StartsWith; |
| 16 | |
| 17 | namespace clang { |
| 18 | namespace clangd { |
| 19 | namespace { |
| 20 | |
| 21 | TWEAK_TEST(DumpSymbol); |
| 22 | |
| 23 | TEST_F(DumpSymbolTest, Test) { |
| 24 | std::string ID = R"("id":"CA2EBE44A1D76D2A")" ; |
| 25 | std::string USR = R"("usr":"c:@F@foo#")" ; |
| 26 | EXPECT_THAT(apply("void f^oo();" ), |
| 27 | AllOf(StartsWith("message:" ), testing::HasSubstr(ID), |
| 28 | testing::HasSubstr(USR))); |
| 29 | } |
| 30 | |
| 31 | } // namespace |
| 32 | } // namespace clangd |
| 33 | } // namespace clang |
| 34 | |