aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/FormatTestJava.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Format/FormatTestJava.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJava.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJava.cpp b/clang/unittests/Format/FormatTestJava.cpp
index 03e16ae..7b25a0b 100644
--- a/clang/unittests/Format/FormatTestJava.cpp
+++ b/clang/unittests/Format/FormatTestJava.cpp
@@ -584,6 +584,17 @@ TEST_F(FormatTestJava, AlignsBlockComments) {
" void f() {}"));
}
+TEST_F(FormatTestJava, AlignDeclarations) {
+ FormatStyle Style = getLLVMStyle(FormatStyle::LK_Java);
+ Style.AlignConsecutiveDeclarations.Enabled = true;
+ verifyFormat("private final String[] args;\n"
+ "private final A_ParserHelper parserHelper;\n"
+ "private final int numOfCmdArgs;\n"
+ "private int numOfCmdArgs;\n"
+ "private String[] args;",
+ Style);
+}
+
TEST_F(FormatTestJava, KeepsDelimitersOnOwnLineInJavaDocComments) {
EXPECT_EQ("/**\n"
" * javadoc line 1\n"