From e2408e37db7e40aa6d79a741a51373f283706c40 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Wed, 6 May 2015 11:16:43 +0000 Subject: clang-format: Fix another assertion discovered by the fuzzer. In the process, fix an old todo that I don't really know how to write tests for. The problem is that Clang's lexer creates very strange token sequences for these. However, the new approach seems generally better and easier to read so I am submitting it nonetheless. llvm-svn: 236589 --- clang/unittests/Format/FormatTest.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'clang/unittests/Format/FormatTest.cpp') diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 31befad6783..ea15312eb5c 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -2951,15 +2951,13 @@ TEST_F(FormatTest, FormatUnbalancedStructuralElements) { format("#define A } }\nint i;", getLLVMStyleWithColumns(11))); } -TEST_F(FormatTest, EscapedNewlineAtStartOfToken) { +TEST_F(FormatTest, EscapedNewlines) { EXPECT_EQ( "#define A \\\n int i; \\\n int j;", format("#define A \\\nint i;\\\n int j;", getLLVMStyleWithColumns(11))); EXPECT_EQ("template f();", format("\\\ntemplate f();")); -} - -TEST_F(FormatTest, NoEscapedNewlineHandlingInBlockComments) { EXPECT_EQ("/* \\ \\ \\\n*/", format("\\\n/* \\ \\ \\\n*/")); + EXPECT_EQ("", format("")); } TEST_F(FormatTest, DontCrashOnBlockComments) { -- cgit v1.2.3