From dc293d3fd18c8dc7b89f1b6615745ef078e6be71 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Wed, 5 Nov 2014 10:48:04 +0000 Subject: clang-format: Improve free-standing macro detection. Before: SOME_WEIRD_LOG_MACRO << "Something long enough to cause a line break"; After: SOME_WEIRD_LOG_MACRO << "Something long enough to cause a line break"; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221338 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Format/FormatTest.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'unittests') diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index cd83265106..9e63bd11bb 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -2569,6 +2569,11 @@ TEST_F(FormatTest, MacrosWithoutTrailingSemicolon) { " Q_Object\n" " A() {\n}\n" "} ;")); + + // Only if the next line can actually start an unwrapped line. + EXPECT_EQ("SOME_WEIRD_LOG_MACRO << SomeThing;", + format("SOME_WEIRD_LOG_MACRO\n" + "<< SomeThing;")); } TEST_F(FormatTest, MacroCallsWithoutTrailingSemicolon) { -- cgit v1.2.3