diff options
author | Daniel Jasper <djasper@google.com> | 2013-11-08 17:33:27 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-11-08 17:33:27 +0000 |
commit | 98fb6e1b9f1fa88dddfc7fb1278302bb760ea050 (patch) | |
tree | aef50d2d9f4d74b0ba0951641f76cf6a11d9a66f /clang/unittests/Format/FormatTest.cpp | |
parent | 4478e5245e208e63d4fe7cdc218f7e9a7aa29978 (diff) | |
download | bcm5719-llvm-98fb6e1b9f1fa88dddfc7fb1278302bb760ea050.tar.gz bcm5719-llvm-98fb6e1b9f1fa88dddfc7fb1278302bb760ea050.zip |
clang-format: Don't auto-break short macros in WebKit style.
This fixes llvm.org/PR17842.
llvm-svn: 194268
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 7e4131bd686..c0c78713db2 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -7081,6 +7081,15 @@ TEST_F(FormatTest, FormatsWithWebKitStyle) { " i++;\n" "}", format("if (aaaaaaaaaaaaaaa || bbbbbbbbbbbbbbb) { i++; }", Style)); + + // Don't automatically break all macro definitions (llvm.org/PR17842). + verifyFormat("#define aNumber 10", Style); + // However, generally keep the line breaks that the user authored. + EXPECT_EQ("#define aNumber \\\n" + " 10", + format("#define aNumber \\\n" + " 10", + Style)); } TEST_F(FormatTest, FormatsProtocolBufferDefinitions) { |