diff options
author | Daniel Jasper <djasper@google.com> | 2016-01-09 15:56:53 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2016-01-09 15:56:53 +0000 |
commit | 417fc81540b529f51649ba0ce82489e496b70ace (patch) | |
tree | f9c4d2c34d15859bf1ffbbd6aa0ef833df90cc8f /clang/unittests/Format/FormatTestSelective.cpp | |
parent | 00693b08cf09af29bf3d0149538cfcf29bbf15a6 (diff) | |
download | bcm5719-llvm-417fc81540b529f51649ba0ce82489e496b70ace.tar.gz bcm5719-llvm-417fc81540b529f51649ba0ce82489e496b70ace.zip |
clang-format: Improve selective comment formatting.
Starting here:
int x; // Format this line only.
int xx; //
int xxxxx; //
Before:
int x; // Format this line only.
int xx; //
int xxxxx; //
After:
int x; // Format this line only.
int xx; //
int xxxxx; //
llvm-svn: 257258
Diffstat (limited to 'clang/unittests/Format/FormatTestSelective.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestSelective.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestSelective.cpp b/clang/unittests/Format/FormatTestSelective.cpp index d53d1c04292..699600c42d9 100644 --- a/clang/unittests/Format/FormatTestSelective.cpp +++ b/clang/unittests/Format/FormatTestSelective.cpp @@ -162,6 +162,13 @@ TEST_F(FormatTestSelective, FormatsCommentsLocally) { "// This is\n" "// not formatted. ", 0, 0)); + EXPECT_EQ("int x; // Format this line.\n" + "int xx; //\n" + "int xxxxx; //", + format("int x; // Format this line.\n" + "int xx; //\n" + "int xxxxx; //", + 0, 0)); } TEST_F(FormatTestSelective, IndividualStatementsOfNestedBlocks) { |