summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format
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
commite317d1b1e8fae926239aa1e0d75fc1ddd679199d (patch)
treef7edd053ac41c652bf624ae2e9d1b8a5ae6a749f /clang/unittests/Format
parentb176cff89de33a17f3e664b612c8b78882b801e0 (diff)
downloadbcm5719-llvm-e317d1b1e8fae926239aa1e0d75fc1ddd679199d.tar.gz
bcm5719-llvm-e317d1b1e8fae926239aa1e0d75fc1ddd679199d.zip
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. llvm-svn: 176350
Diffstat (limited to 'clang/unittests/Format')
-rw-r--r--clang/unittests/Format/FormatTest.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 8cc81684cb4..8b1f69a76e7 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud