summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp41
1 files changed, 40 insertions, 1 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 497015bb095..1f81f5fbd2f 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -951,7 +951,46 @@ TEST_F(FormatTest, UnderstandsSingleLineComments) {
" c\n"
"};",
getLLVMStyleWithColumns(20)));
-
+ EXPECT_EQ("enum A {\n"
+ " a, // line 1\n"
+ " // line 2\n"
+ "};",
+ format("enum A {\n"
+ " a, // line 1\n"
+ " // line 2\n"
+ "};",
+ getLLVMStyleWithColumns(20)));
+ EXPECT_EQ("enum A {\n"
+ " a, // line 1\n"
+ " // line 2\n"
+ "};",
+ format("enum A {\n"
+ " a, // line 1\n"
+ " // line 2\n"
+ "};",
+ getLLVMStyleWithColumns(20)));
+ EXPECT_EQ("enum A {\n"
+ " a, // line 1\n"
+ " // line 2\n"
+ " b\n"
+ "};",
+ format("enum A {\n"
+ " a, // line 1\n"
+ " // line 2\n"
+ " b\n"
+ "};",
+ getLLVMStyleWithColumns(20)));
+ EXPECT_EQ("enum A {\n"
+ " a, // line 1\n"
+ " // line 2\n"
+ " b\n"
+ "};",
+ format("enum A {\n"
+ " a, // line 1\n"
+ " // line 2\n"
+ " b\n"
+ "};",
+ getLLVMStyleWithColumns(20)));
verifyFormat(
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =\n"
" bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb; // Trailing comment");
OpenPOWER on IntegriCloud