[PATCH] D24501: Remove redundant comma around parenthesis in parameter list.

Eric Liu via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 13 08:09:21 PDT 2016


ioeric added inline comments.

================
Comment at: unittests/Format/CleanupTest.cpp:125
@@ -123,7 +124,3 @@
   std::string Expected = "class A {\nA()  {} };";
-  std::vector<tooling::Range> Ranges;
-  Ranges.push_back(tooling::Range(17, 0));
-  Ranges.push_back(tooling::Range(19, 0));
-  std::string Result = cleanup(Code, Ranges);
-  EXPECT_EQ(Expected, Result);
+  EXPECT_EQ(Expected, cleanupAroundOffsets({17, 19}, Code));
 
----------------
djasper wrote:
> I think for such short test cases, at least, I'd just inline the string literals, e.g.:
> 
>   EXPECT_EQ("class A {\nA()  {} };",
>             cleanupAroundOffsets({17, 19}, "class A {\nA() : , {} };"));
> 
> But not sure whether it's better.
I prefer defining variables since it is easier to read/compare and also consistent with other test cases.


https://reviews.llvm.org/D24501





More information about the cfe-commits mailing list