diff options
author | Daniel Jasper <djasper@google.com> | 2016-02-29 12:26:20 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2016-02-29 12:26:20 +0000 |
commit | 35ca66debf3b353b9793b07a412619130dcbd586 (patch) | |
tree | 9f11ade9a085a35d6da66dc40981acab86cfd99b /clang/unittests/Format/FormatTestSelective.cpp | |
parent | 6bb15021b37cd79e0fa8c361880756f90d9b5ba3 (diff) | |
download | bcm5719-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.cpp | 17 |
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) { |