summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clangd/QualityTests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/unittests/clangd/QualityTests.cpp')
-rw-r--r--clang-tools-extra/unittests/clangd/QualityTests.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang-tools-extra/unittests/clangd/QualityTests.cpp b/clang-tools-extra/unittests/clangd/QualityTests.cpp
index d49021243f6..51ebf5cf192 100644
--- a/clang-tools-extra/unittests/clangd/QualityTests.cpp
+++ b/clang-tools-extra/unittests/clangd/QualityTests.cpp
@@ -84,6 +84,7 @@ TEST(QualityTests, SymbolRelevanceSignalExtraction) {
int deprecated() { return 0; }
namespace { struct X { void y() { int z; } }; }
+ struct S{}
)cpp";
auto AST = Test.build();
@@ -115,6 +116,10 @@ TEST(QualityTests, SymbolRelevanceSignalExtraction) {
Relevance = {};
Relevance.merge(CodeCompletionResult(&findAnyDecl(AST, "z"), 42));
EXPECT_EQ(Relevance.Scope, SymbolRelevanceSignals::FunctionScope);
+ // The injected class name is treated as the outer class name.
+ Relevance = {};
+ Relevance.merge(CodeCompletionResult(&findDecl(AST, "S::S"), 42));
+ EXPECT_EQ(Relevance.Scope, SymbolRelevanceSignals::GlobalScope);
}
// Do the signals move the scores in the direction we expect?
OpenPOWER on IntegriCloud