summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2014-04-15 14:52:43 +0000
committerAlexander Kornienko <alexfh@google.com>2014-04-15 14:52:43 +0000
commit64a42b8dd25855ec4e4cb94ed4e51f58b911c358 (patch)
treed9f094ca2cd1f13b34c0b07b5a35d445e0814294 /clang/unittests/Format/FormatTest.cpp
parenteec6fa541c460bacf386b4242c846f5011dcd51d (diff)
downloadbcm5719-llvm-64a42b8dd25855ec4e4cb94ed4e51f58b911c358.tar.gz
bcm5719-llvm-64a42b8dd25855ec4e4cb94ed4e51f58b911c358.zip
Fix assertion when breaking string literals with tab characters.
Summary: Fixes http://llvm.org/PR19368 Reviewers: djasper, klimek Reviewed By: klimek CC: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D3379 llvm-svn: 206295
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 708ddfa0913..f1442e03b68 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -6366,7 +6366,7 @@ TEST_F(FormatTest, ReformatRegionAdjustsIndent) {
67, 0, getLLVMStyle()));
}
-TEST_F(FormatTest, BreakStringLiterals) {
+TEST_F(FormatTest, BreaksStringLiterals) {
EXPECT_EQ("\"some text \"\n"
"\"other\";",
format("\"some text other\";", getLLVMStyleWithColumns(12)));
@@ -6526,6 +6526,16 @@ TEST_F(FormatTest, BreakStringLiterals) {
format("#define A \"some text other\";", AlignLeft));
}
+TEST_F(FormatTest, BreaksStringLiteralsWithTabs) {
+ EXPECT_EQ(
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "(\n"
+ " \"x\t\");",
+ format("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaa("
+ "\"x\t\");"));
+}
+
TEST_F(FormatTest, BreaksWideAndNSStringLiterals) {
EXPECT_EQ(
"u8\"utf8 string \"\n"
OpenPOWER on IntegriCloud