From 9e512bc935318be794bad8ff1bcd14222b6006fc Mon Sep 17 00:00:00 2001 From: Manuel Klimek Date: Wed, 4 Sep 2013 10:06:46 +0000 Subject: [PATCH] More lambda formatting tests; update test comments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189928 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Format/FormatTest.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 3d2cf13c5f..d2b2dfd99b 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -6258,8 +6258,6 @@ TEST_F(FormatTest, FormatsProtocolBufferDefinitions) { } 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 -- 2.40.0