diff options
author | Daniel Jasper <djasper@google.com> | 2013-01-07 11:09:06 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-01-07 11:09:06 +0000 |
commit | 7ad4effaa96905ef9dbc3815760b06b1d1639390 (patch) | |
tree | d658045f8ad4ffcb7d6a2cc8a50f8da9981ddaa1 /unittests/Format/FormatTest.cpp | |
parent | 71607512cb70db3c1be8f0287153b681531687fc (diff) |
Add style option for number of spaces before trailing comments.
In LLVM style, a single space should be enough. In Google style, two
spaces are required.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171725 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index db822e7b37..a743d1b2b5 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -278,21 +278,23 @@ TEST_F(FormatTest, UnderstandsSingleLineComments) { " // Doesn't do anything\n" "}"); - verifyFormat("int i // This is a fancy variable\n" + verifyFormat("int i // This is a fancy variable\n" " = 5;"); verifyFormat("enum E {\n" " // comment\n" - " VAL_A, // comment\n" + " VAL_A, // comment\n" " VAL_B\n" "};"); verifyFormat( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =\n" - " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb; // Trailing comment"); + " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb; // Trailing comment"); - EXPECT_EQ("int i; // single line trailing comment", + EXPECT_EQ("int i; // single line trailing comment", format("int i;\\\n// single line trailing comment")); + + verifyGoogleFormat("int a; // Trailing comment."); } TEST_F(FormatTest, UnderstandsMultiLineComments) { |