Split long strings on word boundaries.
Summary: Split strings at word boundaries, when there are no spaces and slashes.
Reviewers: klimek
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1003
llvm-svn: 184304
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 8454af3..15a5d6b 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -4636,6 +4636,26 @@
"\"slashes\"",
format("\"split/pathat/slashes\"", getLLVMStyleWithColumns(10)));
+ EXPECT_EQ(
+ "\"split/\"\n"
+ "\"pathat/\"\n"
+ "\"slashes\"",
+ format("\"split/pathat/slashes\"", getLLVMStyleWithColumns(10)));
+ EXPECT_EQ("\"split at \"\n"
+ "\"spaces/at/\"\n"
+ "\"slashes.at.any$\"\n"
+ "\"non-alphanumeric%\"\n"
+ "\"1111111111characte\"\n"
+ "\"rs\"",
+ format("\"split at "
+ "spaces/at/"
+ "slashes.at."
+ "any$non-"
+ "alphanumeric%"
+ "1111111111characte"
+ "rs\"",
+ getLLVMStyleWithColumns(20)));
+
FormatStyle AlignLeft = getLLVMStyleWithColumns(12);
AlignLeft.AlignEscapedNewlinesLeft = true;
EXPECT_EQ(