[clang-tools-extra] r343593 - [clangd] Add a #include completion test that triggers an assertion.
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 2 07:46:08 PDT 2018
Author: hokein
Date: Tue Oct 2 07:46:08 2018
New Revision: 343593
URL: http://llvm.org/viewvc/llvm-project?rev=343593&view=rev
Log:
[clangd] Add a #include completion test that triggers an assertion.
Summary: Test for https://reviews.llvm.org/D52774.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D52775
Modified:
clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp
Modified: clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp?rev=343593&r1=343592&r2=343593&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp (original)
+++ clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp Tue Oct 2 07:46:08 2018
@@ -2093,6 +2093,15 @@ TEST(CompletionTest, IncludedCompletionK
Has("bar.h\"", CompletionItemKind::File)));
}
+TEST(CompletionTest, NoCrashAtNonAlphaIncludeHeader) {
+ auto Results = completions(
+ R"cpp(
+ #include "./^"
+ )cpp"
+ );
+ EXPECT_TRUE(Results.Completions.empty());
+}
+
TEST(CompletionTest, NoAllScopesCompletionWhenQualified) {
clangd::CodeCompleteOptions Opts = {};
Opts.AllScopes = true;
More information about the cfe-commits
mailing list