aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/FormatTestJava.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-11-23 20:54:37 +0000
committerDaniel Jasper <djasper@google.com>2014-11-23 20:54:37 +0000
commita0143fab5e2c17445b60c1931378346edc1507e4 (patch)
tree651bda6476dd1f12e5128c14d2bccd771c69ed5a /clang/unittests/Format/FormatTestJava.cpp
parentbb86d847ba53d52e110bf94d38266a9f4d286996 (diff)
downloadllvm-a0143fab5e2c17445b60c1931378346edc1507e4.zip
llvm-a0143fab5e2c17445b60c1931378346edc1507e4.tar.gz
llvm-a0143fab5e2c17445b60c1931378346edc1507e4.tar.bz2
clang-format: [Java] Space before array initializers.
Before: new int[]{1, 2, 3, 4}; After: new int[] {1, 2, 3, 4}; llvm-svn: 222640
Diffstat (limited to 'clang/unittests/Format/FormatTestJava.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJava.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/clang/unittests/Format/FormatTestJava.cpp b/clang/unittests/Format/FormatTestJava.cpp
index 8c9504b..ba91f16 100644
--- a/clang/unittests/Format/FormatTestJava.cpp
+++ b/clang/unittests/Format/FormatTestJava.cpp
@@ -144,8 +144,8 @@ TEST_F(FormatTestJava, EnumDeclarations) {
" }\n"
"}");
verifyFormat("enum SomeThing {\n"
- " ABC(new int[]{1, 2}),\n"
- " CDE(new int[]{2, 3});\n"
+ " ABC(new int[] {1, 2}),\n"
+ " CDE(new int[] {2, 3});\n"
" Something(int[] i) {\n"
" }\n"
"}");
@@ -180,6 +180,13 @@ TEST_F(FormatTestJava, EnumDeclarations) {
"}");
}
+TEST_F(FormatTestJava, ArrayInitializers) {
+ verifyFormat("new int[] {1, 2, 3, 4};");
+ verifyFormat("new int[] {\n"
+ " 1, 2, 3, 4,\n"
+ "};");
+}
+
TEST_F(FormatTestJava, ThrowsDeclarations) {
verifyFormat("public void doSooooooooooooooooooooooooooomething()\n"
" throws LooooooooooooooooooooooooooooongException {\n}");