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 | bd04f2aa2247f2fda3fd8f3fee90479ba2c94499 (patch) | |
tree | ae703493e7dec03ae8923bbad0c8ef6dcc1fcda4 /unittests/Format/FormatTest.cpp | |
parent | f343cabb68d495041706b8e2f1ed48fbac3cba06 (diff) |
Never break inside something that was a preprocessor directive.
Just put it in one unwrapped line and let the formatter handle it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 5ffd351889..bffbbf5331 100644 --- a/unittests/Format/FormatTest.cpp +++ b/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;"); } |