diff options
author | Daniel Jasper <djasper@google.com> | 2013-03-20 10:23:53 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-03-20 10:23:53 +0000 |
commit | bcca7e484117f3155ff98f9560996e760ca4f786 (patch) | |
tree | 5eea66a6ed85122a5b897b95292a05f1f52be259 /unittests/Format | |
parent | 7c4a9a04b4b2a44259b34078434e087987872095 (diff) |
Don't remove all indentation when in #defines.
Otherwise, this can become hard to read.
Before: #define A \
case 1:
After: #define A \
case 1:
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177509 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 18ba143e00..3253347686 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -441,6 +441,11 @@ TEST_F(FormatTest, FormatsSwitchStatement) { " }\n" " break;\n" "}"); + verifyFormat("#define A \\\n" + " switch (x) { \\\n" + " case a: \\\n" + " foo = b; \\\n" + " }", getLLVMStyleWithColumns(20)); verifyGoogleFormat("switch (x) {\n" " case 1:\n" @@ -1209,7 +1214,7 @@ TEST_F(FormatTest, MacroDefinitionsWithIncompleteCode) { // FIXME: Improve formatting of case labels in macros. verifyFormat("#define SOMECASES \\\n" - "case 1: \\\n" + " case 1: \\\n" " case 2\n", getLLVMStyleWithColumns(20)); |