aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-03-01 13:29:19 +0000
committerManuel Klimek <klimek@google.com>2013-03-01 13:29:19 +0000
commitbc30c71d20f05bc39b5dd73f06ee4dede9c55710 (patch)
treea673a3ff9ab97300ccd948938a8d2215f5b550e0 /unittests/Format/FormatTest.cpp
parentaf31fd7021e685280da9155e5017f1053b05fdf8 (diff)
Implements breaking string literals at slashes.
We now break at a slash if we do not find a space to break on. Also fixes a bug where we would go over the limit when breaking the second line. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176350 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 8cc81684cb..8b1f69a76e 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -3045,9 +3045,15 @@ TEST_F(FormatTest, BreakStringLiterals) {
EXPECT_EQ(
"\"splitmea\"\n"
- "\"trandompo\"\n"
- "\"int\"",
+ "\"trandomp\"\n"
+ "\"oint\"",
format("\"splitmeatrandompoint\"", getLLVMStyleWithColumns(10)));
+
+ EXPECT_EQ(
+ "\"split/\"\n"
+ "\"pathat/\"\n"
+ "\"slashes\"",
+ format("\"split/pathat/slashes\"", getLLVMStyleWithColumns(10)));
}
} // end namespace tooling