summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clangd/IndexTests.cpp
diff options
context:
space:
mode:
authorKadir Cetinkaya <kadircet@google.com>2019-03-20 09:43:38 +0000
committerKadir Cetinkaya <kadircet@google.com>2019-03-20 09:43:38 +0000
commit44a63f6a150dec72dea43730d2a89d292e58bd6f (patch)
treead942541fba94bb7fdc265a73069228ffc805c2f /clang-tools-extra/unittests/clangd/IndexTests.cpp
parentfc2a74734574f752c3371369794904f10f2531a3 (diff)
downloadbcm5719-llvm-44a63f6a150dec72dea43730d2a89d292e58bd6f.tar.gz
bcm5719-llvm-44a63f6a150dec72dea43730d2a89d292e58bd6f.zip
[clangd] Print arguments in template specializations
Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59354 llvm-svn: 356541
Diffstat (limited to 'clang-tools-extra/unittests/clangd/IndexTests.cpp')
-rw-r--r--clang-tools-extra/unittests/clangd/IndexTests.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/clang-tools-extra/unittests/clangd/IndexTests.cpp b/clang-tools-extra/unittests/clangd/IndexTests.cpp
index 3a159279733..70dda71156c 100644
--- a/clang-tools-extra/unittests/clangd/IndexTests.cpp
+++ b/clang-tools-extra/unittests/clangd/IndexTests.cpp
@@ -187,35 +187,30 @@ TEST(MemIndexTest, TemplateSpecialization) {
SymbolSlab::Builder B;
Symbol S = symbol("TempSpec");
- S.ID = SymbolID("0");
B.insert(S);
- S = symbol("TempSpec");
- S.ID = SymbolID("1");
+ S = symbol("TempSpec<int, bool>");
S.SymInfo.Properties = static_cast<index::SymbolPropertySet>(
index::SymbolProperty::TemplateSpecialization);
B.insert(S);
- S = symbol("TempSpec");
- S.ID = SymbolID("2");
+ S = symbol("TempSpec<int, U>");
S.SymInfo.Properties = static_cast<index::SymbolPropertySet>(
index::SymbolProperty::TemplatePartialSpecialization);
B.insert(S);
auto I = MemIndex::build(std::move(B).build(), RefSlab());
FuzzyFindRequest Req;
- Req.Query = "TempSpec";
Req.AnyScope = true;
- std::vector<Symbol> Symbols;
- I->fuzzyFind(Req, [&Symbols](const Symbol &Sym) { Symbols.push_back(Sym); });
- EXPECT_EQ(Symbols.size(), 1U);
- EXPECT_FALSE(Symbols.front().SymInfo.Properties &
- static_cast<index::SymbolPropertySet>(
- index::SymbolProperty::TemplateSpecialization));
- EXPECT_FALSE(Symbols.front().SymInfo.Properties &
- static_cast<index::SymbolPropertySet>(
- index::SymbolProperty::TemplatePartialSpecialization));
+ Req.Query = "TempSpec";
+ EXPECT_THAT(match(*I, Req),
+ UnorderedElementsAre("TempSpec", "TempSpec<int, bool>",
+ "TempSpec<int, U>"));
+
+ Req.Query = "TempSpec<int";
+ EXPECT_THAT(match(*I, Req),
+ UnorderedElementsAre("TempSpec<int, bool>", "TempSpec<int, U>"));
}
TEST(MergeIndexTest, Lookup) {
OpenPOWER on IntegriCloud