diff options
author | Manuel Klimek <klimek@google.com> | 2013-02-20 15:25:48 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2013-02-20 15:25:48 +0000 |
commit | b56b6d1bd6f41d7b944a9631a9ab481cafe6535b (patch) | |
tree | 3b631a7d6ed6256ee924bee1bd15eaecfd444f50 /unittests/Format/FormatTest.cpp | |
parent | c4615b7aaf97e303a4fc675956f7f5572d492885 (diff) |
Fixes bug in string literal alignment.
We now indent the following correctly:
1. some + "literal" /* comment */
"literal";
2. breaking string literals after which we have another string literal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175628 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index dba6183e09..ab4825b314 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -1439,6 +1439,19 @@ TEST_F(FormatTest, AlignsStringLiterals) { verifyFormat("someFunction(\"Always break between multi-line\"\n" " \" string literals\",\n" " and, other, parameters);"); + EXPECT_EQ("fun + \"1243\" /* comment */\n" + " \"5678\";", + format("fun + \"1243\" /* comment */\n" + " \"5678\";", + getLLVMStyleWithColumns(28))); + EXPECT_EQ( + "aaaaaa = \"aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaa \"\n" + " \"aaaaaaaaaaaaaaaaaaaaa\"\n" + " \"aaaaaaaaaaaaaaaa\";", + format("aaaaaa =" + "\"aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaa " + "aaaaaaaaaaaaaaaaaaaaa\" " + "\"aaaaaaaaaaaaaaaa\";")); } TEST_F(FormatTest, AlignsPipes) { |