diff options
author | Daniel Jasper <djasper@google.com> | 2013-02-08 16:49:27 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-02-08 16:49:27 +0000 |
commit | 087387a1e9ce5abeb4f348e14f64e5c2273eaedb (patch) | |
tree | d18e10b7c80ffdbaf967ab3d606da9d1332bfe57 /unittests/Format/FormatTest.cpp | |
parent | 29f123b2fa0435bb1962f0d9e9a2e660f35fbb2f (diff) |
Fix handling of fake parenthesis during formatting.
They are much easier to handle when attached to the previous token.
Before:
unsigned Indent =
formatFirstToken(TheLine.First, IndentForLevel[TheLine.Level] >=
0 ? IndentForLevel[TheLine.Level]
: TheLine.Level * 2, TheLine.InPPDirective, PreviousEndOfLineColumn);
After:
unsigned Indent = formatFirstToken(
TheLine.First, IndentForLevel[TheLine.Level] >= 0
? IndentForLevel[TheLine.Level] : TheLine.Level * 2,
TheLine.InPPDirective, PreviousEndOfLineColumn);
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174718 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-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 7176fa5a97..997a55353b 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -1271,6 +1271,11 @@ TEST_F(FormatTest, BreaksConditionalExpressions) { " : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n" " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa),\n" " aaaaaaaaaaaaaaaaaaaaaaaaaaa);"); + verifyFormat( + "unsigned Indent = formatFirstToken(\n" + " TheLine.First, IndentForLevel[TheLine.Level] >= 0\n" + " ? IndentForLevel[TheLine.Level] : TheLine * 2,\n" + " TheLine.InPPDirective, PreviousEndOfLineColumn);"); } TEST_F(FormatTest, DeclarationsOfMultipleVariables) { |