diff options
author | Krasimir Georgiev <krasimir@google.com> | 2019-04-12 10:11:34 +0000 |
---|---|---|
committer | Krasimir Georgiev <krasimir@google.com> | 2019-04-12 10:11:34 +0000 |
commit | 69150467b098322253627641f55ffeeafbcc32e4 (patch) | |
tree | 174db446c09a5b2fbd51bd08b9750463e6a65cad /clang/unittests/Format/FormatTestProto.cpp | |
parent | 4f789e1b39324d00f0481528b8c958bf7755e835 (diff) | |
download | bcm5719-llvm-69150467b098322253627641f55ffeeafbcc32e4.tar.gz bcm5719-llvm-69150467b098322253627641f55ffeeafbcc32e4.zip |
[clang-format] Use SpacesBeforeTrailingComments for "option" directive
Summary:
AnnotatingParser::next() is needed to implicitly set TT_BlockComment
versus TT_LineComment. On most other paths through
AnnotatingParser::parseLine(), all tokens are consumed to achieve that.
This change updates one place where this wasn't done.
Contributed by @dchai!
Reviewers: krasimir
Reviewed By: krasimir
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60541
llvm-svn: 358275
Diffstat (limited to 'clang/unittests/Format/FormatTestProto.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestProto.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestProto.cpp b/clang/unittests/Format/FormatTestProto.cpp index d5683b5b844..ac042316bc2 100644 --- a/clang/unittests/Format/FormatTestProto.cpp +++ b/clang/unittests/Format/FormatTestProto.cpp @@ -193,6 +193,10 @@ TEST_F(FormatTestProto, DoesntWrapFileOptions) { "\"some.really.long.package.that.exceeds.the.column.limit\";")); } +TEST_F(FormatTestProto, TrailingCommentAfterFileOption) { + verifyFormat("option java_package = \"foo.pkg\"; // comment\n"); +} + TEST_F(FormatTestProto, FormatsOptions) { verifyFormat("option (MyProto.options) = {\n" " field_a: OK\n" |