diff options
author | Manuel Klimek <klimek@google.com> | 2013-01-31 15:58:48 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2013-01-31 15:58:48 +0000 |
commit | 591b58025591decba7602813679145bd380a0851 (patch) | |
tree | 8298cd53167cb2dfe8b1def11db844df10625677 /clang/unittests/Format/FormatTest.cpp | |
parent | 8a8ce2406a2283b428bd62a4820a2657e8aa902f (diff) | |
download | bcm5719-llvm-591b58025591decba7602813679145bd380a0851.tar.gz bcm5719-llvm-591b58025591decba7602813679145bd380a0851.zip |
Never break inside something that was a preprocessor directive.
Just put it in one unwrapped line and let the formatter handle it.
llvm-svn: 174063
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 5ffd3518891..bffbbf53316 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -714,8 +714,10 @@ TEST_F(FormatTest, DoesNotBreakPureVirtualFunctionDefinition) { " OwningPtr<FileOutputBuffer> &buffer) = 0;"); } -TEST_F(FormatTest, BreaksOnHashWhenDirectiveIsInvalid) { - EXPECT_EQ("#\n;", format("#;")); +TEST_F(FormatTest, LayoutUnknownPPDirective) { + EXPECT_EQ("#123 \"A string literal\"", + format(" # 123 \"A string literal\"")); + EXPECT_EQ("#;", format("#;")); verifyFormat("#\n;\n;\n;"); } |