aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-02-20 15:25:48 +0000
committerManuel Klimek <klimek@google.com>2013-02-20 15:25:48 +0000
commitb56b6d1bd6f41d7b944a9631a9ab481cafe6535b (patch)
tree3b631a7d6ed6256ee924bee1bd15eaecfd444f50 /unittests/Format/FormatTest.cpp
parentc4615b7aaf97e303a4fc675956f7f5572d492885 (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.cpp13
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) {