[clangd] Work around compiler macro expansion bugs(?) in completion tests
authorSam McCall <sam.mccall@gmail.com>
Fri, 14 Sep 2018 18:49:16 +0000 (18:49 +0000)
committerSam McCall <sam.mccall@gmail.com>
Fri, 14 Sep 2018 18:49:16 +0000 (18:49 +0000)
llvm-svn: 342261

clang-tools-extra/unittests/clangd/CodeCompleteTests.cpp

index 9a70376..e6720a3 100644 (file)
@@ -662,15 +662,15 @@ TEST(CompletionTest, IndexSuppressesPreambleCompletions) {
 // try to complete inside it, clang kicks our completion point just outside the
 // preamble, resulting in always getting top-level completions.
 TEST(CompletionTest, CompletionInPreamble) {
-  EXPECT_THAT(completions(R"cpp(
+  auto Results = completions(R"cpp(
     #ifnd^ef FOO_H_
     #define BAR_H_
     #include <bar.h>
     int foo() {}
     #endif
     )cpp")
-                  .Completions,
-              ElementsAre(Named("ifndef")));
+                     .Completions;
+  EXPECT_THAT(Results, ElementsAre(Named("ifndef")));
 };
 
 TEST(CompletionTest, DynamicIndexMultiFile) {