summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestTextProto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Format/FormatTestTextProto.cpp')
-rw-r--r--clang/unittests/Format/FormatTestTextProto.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestTextProto.cpp b/clang/unittests/Format/FormatTestTextProto.cpp
index 39a2e71cbbd..1f2f2b61236 100644
--- a/clang/unittests/Format/FormatTestTextProto.cpp
+++ b/clang/unittests/Format/FormatTestTextProto.cpp
@@ -143,6 +143,23 @@ TEST_F(FormatTestTextProto, AddsNewlinesAfterTrailingComments) {
"}");
}
+TEST_F(FormatTestTextProto, ImplicitStringLiteralConcatenation) {
+ verifyFormat("field_a: 'aaaaa'\n"
+ " 'bbbbb'");
+ verifyFormat("field_a: \"aaaaa\"\n"
+ " \"bbbbb\"");
+ FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
+ Style.AlwaysBreakBeforeMultilineStrings = true;
+ verifyFormat("field_a:\n"
+ " 'aaaaa'\n"
+ " 'bbbbb'",
+ Style);
+ verifyFormat("field_a:\n"
+ " \"aaaaa\"\n"
+ " \"bbbbb\"",
+ Style);
+}
+
TEST_F(FormatTestTextProto, SupportsAngleBracketMessageFields) {
// Single-line tests
verifyFormat("msg_field <>");
OpenPOWER on IntegriCloud