diff options
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index cdf2f94cf3f..97cc2614e89 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -3680,6 +3680,13 @@ TEST_F(FormatTest, AlignsStringLiterals) { verifyFormat("#define A \"def\"\n" "f(\"abc\" A \"ghi\"\n" " \"jkl\");"); + + verifyFormat("f(L\"a\"\n" + " L\"b\")"); + verifyFormat("#define A(X) \\\n" + " L\"aaaaa\" #X L\"bbbbbb\" \\\n" + " L\"ccccc\"", + getLLVMStyleWithColumns(25)); } TEST_F(FormatTest, AlwaysBreakBeforeMultilineStrings) { @@ -3708,6 +3715,10 @@ TEST_F(FormatTest, AlwaysBreakBeforeMultilineStrings) { " \"bbbb\"\n" " \"cccc\");", Break); + verifyFormat("aaaa(qqq,\n" + " L\"bbbb\"\n" + " L\"cccc\");", + Break); // Don't break if there is no column gain. verifyFormat("f(\"aaaa\"\n" |