summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestSelective.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2016-02-29 12:26:20 +0000
committerDaniel Jasper <djasper@google.com>2016-02-29 12:26:20 +0000
commit35ca66debf3b353b9793b07a412619130dcbd586 (patch)
tree9f11ade9a085a35d6da66dc40981acab86cfd99b /clang/unittests/Format/FormatTestSelective.cpp
parent6bb15021b37cd79e0fa8c361880756f90d9b5ba3 (diff)
downloadbcm5719-llvm-35ca66debf3b353b9793b07a412619130dcbd586.tar.gz
bcm5719-llvm-35ca66debf3b353b9793b07a412619130dcbd586.zip
clang-format: Don't format unrelated nested blocks.
With this change: SomeFunction( [] { int i; return i; // Format this line. }, [] { return 2; // Don't "fix" this. }); llvm-svn: 262216
Diffstat (limited to 'clang/unittests/Format/FormatTestSelective.cpp')
-rw-r--r--clang/unittests/Format/FormatTestSelective.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestSelective.cpp b/clang/unittests/Format/FormatTestSelective.cpp
index 699600c42d9..5885cadee62 100644
--- a/clang/unittests/Format/FormatTestSelective.cpp
+++ b/clang/unittests/Format/FormatTestSelective.cpp
@@ -278,6 +278,23 @@ TEST_F(FormatTestSelective, IndividualStatementsOfNestedBlocks) {
" };\n"
"});",
0, 0));
+ EXPECT_EQ("SomeFunction(\n"
+ " [] {\n"
+ " int i;\n"
+ " return i;\n" // Format this line.
+ " },\n"
+ " [] {\n"
+ " return 2;\n" // Don't fix this.
+ " });",
+ format("SomeFunction(\n"
+ " [] {\n"
+ " int i;\n"
+ " return i;\n" // Format this line.
+ " },\n"
+ " [] {\n"
+ " return 2;\n" // Don't fix this.
+ " });",
+ 40, 0));
}
TEST_F(FormatTestSelective, WrongIndent) {
OpenPOWER on IntegriCloud