[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

llvm-svn: 343593
This commit is contained in:
Haojian Wu 2018-10-02 14:46:08 +00:00
parent 714e971540
commit 1c6b6deb33
1 changed files with 9 additions and 0 deletions

View File

@ -2093,6 +2093,15 @@ TEST(CompletionTest, IncludedCompletionKinds) {
Has("bar.h\"", CompletionItemKind::File))); Has("bar.h\"", CompletionItemKind::File)));
} }
TEST(CompletionTest, NoCrashAtNonAlphaIncludeHeader) {
auto Results = completions(
R"cpp(
#include "./^"
)cpp"
);
EXPECT_TRUE(Results.Completions.empty());
}
TEST(CompletionTest, NoAllScopesCompletionWhenQualified) { TEST(CompletionTest, NoAllScopesCompletionWhenQualified) {
clangd::CodeCompleteOptions Opts = {}; clangd::CodeCompleteOptions Opts = {};
Opts.AllScopes = true; Opts.AllScopes = true;