diff options
author | Daniel Jasper <djasper@google.com> | 2014-11-05 10:48:04 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-11-05 10:48:04 +0000 |
commit | dc293d3fd18c8dc7b89f1b6615745ef078e6be71 (patch) | |
tree | ce796a9be8a2d3382f6b2687d5830a0af0025923 /unittests | |
parent | c3863c73e53ca9d8f8919af68a5a219fd91778ea (diff) |
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
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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) { |