[PATCH] D128677: [clang][Tooling] Add support for generating #import edits

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 6 07:55:00 PST 2022


kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.

thanks!



================
Comment at: clang/unittests/Tooling/HeaderIncludesTest.cpp:77
+TEST_F(HeaderIncludesTest, DeleteImportAndSameInclude) {
+  std::string Code = "#include \"abc.h\"\n"
+                     "#import \"abc.h\"\n"
----------------
nit: feel free to use raw string literals here and in other tests (or angled (`<`) includes), e.g:
```
llvm::StringRef Code = R"cpp(
  #include <abc.h>
  #import <abc.h>
  int x;)cpp";
EXPECT_EQ("int x;", remove(Code, "<abc.h>"));
```


================
Comment at: clang/unittests/Tooling/HeaderIncludesTest.cpp:81
+  std::string Expected = "int x;\n";
+  EXPECT_EQ(Expected, remove(Code, "\"abc.h\""));
+}
----------------
nit: just inline `"int x"` to the LHS.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128677/new/

https://reviews.llvm.org/D128677



More information about the cfe-commits mailing list