clang-format: Fix assertion on incomplete string literals.
Before, this could would lead to an assert:
llvm::errs() << "
<< a;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191639 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 08b5643..833a87c 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -3398,6 +3398,11 @@
verifyFormat(
"llvm::errs() << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
" .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa();");
+
+ // Incomplete string literal.
+ EXPECT_EQ("llvm::errs() << \"\n"
+ " << a;",
+ format("llvm::errs() << \"\n<<a;"));
}
TEST_F(FormatTest, UnderstandsEquals) {