diff options
Diffstat (limited to 'clang-tools-extra/unittests/clangd/FileIndexTests.cpp')
-rw-r--r-- | clang-tools-extra/unittests/clangd/FileIndexTests.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang-tools-extra/unittests/clangd/FileIndexTests.cpp b/clang-tools-extra/unittests/clangd/FileIndexTests.cpp index adae1f1b3b9..85352bc924c 100644 --- a/clang-tools-extra/unittests/clangd/FileIndexTests.cpp +++ b/clang-tools-extra/unittests/clangd/FileIndexTests.cpp @@ -78,8 +78,7 @@ std::vector<std::string> match(const SymbolIndex &I, std::vector<std::string> Matches; auto Ctx = Context::empty(); I.fuzzyFind(Ctx, Req, [&](const Symbol &Sym) { - Matches.push_back( - (Sym.Scope + (Sym.Scope.empty() ? "" : "::") + Sym.Name).str()); + Matches.push_back((Sym.Scope + Sym.Name).str()); }); return Matches; } @@ -110,7 +109,7 @@ TEST(FileIndexTest, IndexAST) { FuzzyFindRequest Req; Req.Query = ""; - Req.Scopes = {"ns"}; + Req.Scopes = {"ns::"}; EXPECT_THAT(match(M, Req), UnorderedElementsAre("ns::f", "ns::X")); } @@ -139,7 +138,7 @@ TEST(FileIndexTest, IndexMultiASTAndDeduplicate) { FuzzyFindRequest Req; Req.Query = ""; - Req.Scopes = {"ns"}; + Req.Scopes = {"ns::"}; EXPECT_THAT(match(M, Req), UnorderedElementsAre("ns::f", "ns::X", "ns::ff")); } @@ -152,7 +151,7 @@ TEST(FileIndexTest, RemoveAST) { FuzzyFindRequest Req; Req.Query = ""; - Req.Scopes = {"ns"}; + Req.Scopes = {"ns::"}; EXPECT_THAT(match(M, Req), UnorderedElementsAre("ns::f", "ns::X")); M.update(Ctx, "f1", nullptr); |