[clang-tools-extra] r343536 - [clang-query] Test non-code-completion on single letter shortcuts

Stephen Kelly via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 1 13:45:44 PDT 2018


Author: steveire
Date: Mon Oct  1 13:45:44 2018
New Revision: 343536

URL: http://llvm.org/viewvc/llvm-project?rev=343536&view=rev
Log:
[clang-query] Test non-code-completion on single letter shortcuts

Modified:
    clang-tools-extra/trunk/unittests/clang-query/QueryParserTest.cpp

Modified: clang-tools-extra/trunk/unittests/clang-query/QueryParserTest.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-query/QueryParserTest.cpp?rev=343536&r1=343535&r2=343536&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-query/QueryParserTest.cpp (original)
+++ clang-tools-extra/trunk/unittests/clang-query/QueryParserTest.cpp Mon Oct  1 13:45:44 2018
@@ -170,4 +170,14 @@ TEST_F(QueryParserTest, Complete) {
   EXPECT_EQ("Stmt(", Comps[0].TypedText);
   EXPECT_EQ("Matcher<Stmt> whileStmt(Matcher<WhileStmt>...)",
             Comps[0].DisplayText);
+
+  Comps = QueryParser::complete("m", 1, QS);
+  ASSERT_EQ(1u, Comps.size());
+  EXPECT_EQ("atch ", Comps[0].TypedText);
+  EXPECT_EQ("match", Comps[0].DisplayText);
+
+  Comps = QueryParser::complete("l", 1, QS);
+  ASSERT_EQ(1u, Comps.size());
+  EXPECT_EQ("et ", Comps[0].TypedText);
+  EXPECT_EQ("let", Comps[0].DisplayText);
 }




More information about the cfe-commits mailing list