aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 97539d91a6..97d4df8e5e 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -2974,16 +2974,16 @@ TEST_F(FormatTest, MergeHandlingInTheFaceOfPreprocessorDirectives) {
format("if (true)\nreturn 42;", AllowsMergedIf));
FormatStyle ShortMergedIf = AllowsMergedIf;
ShortMergedIf.ColumnLimit = 25;
- verifyFormat("#define A \\\n"
+ verifyFormat("#define A \\\n"
" if (true) return 42;",
ShortMergedIf);
- verifyFormat("#define A \\\n"
- " f(); \\\n"
+ verifyFormat("#define A \\\n"
+ " f(); \\\n"
" if (true)\n"
"#define B",
ShortMergedIf);
- verifyFormat("#define A \\\n"
- " f(); \\\n"
+ verifyFormat("#define A \\\n"
+ " f(); \\\n"
" if (true)\n"
"g();",
ShortMergedIf);
@@ -3800,6 +3800,15 @@ TEST_F(FormatTest, BreakStringLiterals) {
"\"pathat/\"\n"
"\"slashes\"",
format("\"split/pathat/slashes\"", getLLVMStyleWithColumns(10)));
+
+ FormatStyle AlignLeft = getLLVMStyleWithColumns(12);
+ AlignLeft.AlignEscapedNewlinesLeft = true;
+ EXPECT_EQ(
+ "#define A \\\n"
+ " \"some \" \\\n"
+ " \"text \" \\\n"
+ " \"other\";",
+ format("#define A \"some text other\";", AlignLeft));
}
TEST_F(FormatTest, DoNotBreakStringLiteralsInEscapeSequence) {