diff options
| author | Daniel Jasper <djasper@google.com> | 2013-07-16 20:28:33 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2013-07-16 20:28:33 +0000 |
| commit | 8369aa5e12b6c5a0285c3e672e680e58be1d779c (patch) | |
| tree | 81fcabc82c3ad9f722ee45ef1407b03aa50d890e /clang/unittests/Format/FormatTest.cpp | |
| parent | f9a26199303f8609c0b013fdc792453239149e9b (diff) | |
| download | bcm5719-llvm-8369aa5e12b6c5a0285c3e672e680e58be1d779c.tar.gz bcm5719-llvm-8369aa5e12b6c5a0285c3e672e680e58be1d779c.zip | |
clang-format: Improve handling of unterminated string literals.
Before, clang-format would simply eat these as they were recognized as
whitespace. With this patch, they are mostly left alone.
llvm-svn: 186454
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index aa2a70987ba..3d5c21a2f77 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -5004,6 +5004,11 @@ TEST_F(FormatTest, SkipsUnknownStringLiterals) { format("L\"unsupported literal\";", getGoogleStyleWithColumns(15))); EXPECT_EQ("R\"x(raw literal)x\";", format("R\"x(raw literal)x\";", getGoogleStyleWithColumns(15))); + verifyFormat("string a = \"unterminated;"); + EXPECT_EQ("function(\"unterminated,\n" + " OtherParameter);", + format("function( \"unterminated,\n" + " OtherParameter);")); } TEST_F(FormatTest, DoesNotTryToParseUDLiteralsInPreCpp11Code) { |

