1 //===-- AnnotateHighlightingsTests.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 "gtest/gtest.h" 11 12 namespace clang { 13 namespace clangd { 14 namespace { 15 16 TWEAK_TEST(AnnotateHighlightings); 17 TEST_F(AnnotateHighlightingsTest,Test)18TEST_F(AnnotateHighlightingsTest, Test) { 19 EXPECT_AVAILABLE("^vo^id^ ^f(^) {^}^"); // available everywhere. 20 EXPECT_AVAILABLE("[[int a; int b;]]"); 21 EXPECT_EQ("void /* entity.name.function.cpp */f() {}", apply("void ^f() {}")); 22 23 EXPECT_EQ(apply("[[void f1(); void f2();]]"), 24 "void /* entity.name.function.cpp */f1(); " 25 "void /* entity.name.function.cpp */f2();"); 26 27 EXPECT_EQ(apply("void f1(); void f2() {^}"), 28 "void f1(); " 29 "void /* entity.name.function.cpp */f2() {}"); 30 } 31 32 } // namespace 33 } // namespace clangd 34 } // namespace clang 35