From 417fc81540b529f51649ba0ce82489e496b70ace Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Sat, 9 Jan 2016 15:56:53 +0000 Subject: 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 --- clang/unittests/Format/FormatTestSelective.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/unittests/Format/FormatTestSelective.cpp') 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) { -- cgit v1.2.3