r189928 - More lambda formatting tests; update test comments.

Manuel Klimek klimek at google.com
Wed Sep 4 03:06:47 PDT 2013


Author: klimek
Date: Wed Sep  4 05:06:46 2013
New Revision: 189928

URL: http://llvm.org/viewvc/llvm-project?rev=189928&view=rev
Log:
More lambda formatting tests; update test comments.

Modified:
    cfe/trunk/unittests/Format/FormatTest.cpp

Modified: cfe/trunk/unittests/Format/FormatTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=189928&r1=189927&r2=189928&view=diff
==============================================================================
--- cfe/trunk/unittests/Format/FormatTest.cpp (original)
+++ cfe/trunk/unittests/Format/FormatTest.cpp Wed Sep  4 05:06:46 2013
@@ -6258,8 +6258,6 @@ TEST_F(FormatTest, FormatsProtocolBuffer
 }
 
 TEST_F(FormatTest, FormatsLambdas) {
-  // FIXME: The formatting is incorrect; this test currently checks that
-  // parsing of the unwrapped lines doesn't regress.
   verifyFormat(
       "int c = [b]() mutable {\n"
       "  return [&b] {\n"
@@ -6295,6 +6293,22 @@ TEST_F(FormatTest, FormatsLambdas) {
       "  [=, a, b, &c] {\n"
       "  }();\n"
       "} }\n");
+  verifyFormat(
+      "void f() {\n"
+      "  other(x.begin(), x.end(), [&](int, int) {\n"
+      "    return 1;\n"
+      "  });\n"
+      "}\n");
+  // FIXME: The formatting is incorrect; this test currently checks that
+  // parsing of the unwrapped lines doesn't regress.
+  verifyFormat(
+      "void f() {\n"
+      "  other(x.begin(), //\n"
+      "        x.end(),   //\n"
+      "                     [&](int, int) {\n"
+      "    return 1;\n"
+      "  });\n"
+      "}\n");
 }
 
 } // end namespace tooling





More information about the cfe-commits mailing list