diff options
| author | Daniel Jasper <djasper@google.com> | 2014-06-10 06:27:23 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2014-06-10 06:27:23 +0000 |
| commit | 3251fff0e3d1fa4389ccef5ffa3223e47739f5af (patch) | |
| tree | 4fb5178b255907bc93fa2d402e152cca1f204b8b /clang/unittests/Format/FormatTest.cpp | |
| parent | ed2c033b9beed8448945e340195ec426ef73ffdd (diff) | |
| download | bcm5719-llvm-3251fff0e3d1fa4389ccef5ffa3223e47739f5af.tar.gz bcm5719-llvm-3251fff0e3d1fa4389ccef5ffa3223e47739f5af.zip | |
clang-format: Handle multiline strings inside ternary expressions.
With AlwaysSplitBeforeMultilineStrings, clang-format would not find any
valid solution.
llvm-svn: 210513
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index cf5c9ff1efb..584ecba9866 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -4167,6 +4167,12 @@ TEST_F(FormatTest, AlwaysBreakBeforeMultilineStrings) { " L\"cccc\");", Break); + // As we break before unary operators, breaking right after them is bad. + verifyFormat("string foo = abc ? \"x\"\n" + " \"blah blah blah blah blah blah\"\n" + " : \"y\";", + Break); + // Don't break if there is no column gain. verifyFormat("f(\"aaaa\"\n" " \"bbbb\");", |

