diff options
author | Daniel Jasper <djasper@google.com> | 2014-11-23 20:54:37 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-11-23 20:54:37 +0000 |
commit | 4efe2c94ef9cc88721e28b0b72ae5abc4b6fdcdc (patch) | |
tree | b30a79a88734218c801dfa54babb8e53a2685758 /unittests/Format/FormatTestJava.cpp | |
parent | c26dc84ec1413a4250ff76307ef430959ad3a969 (diff) |
clang-format: [Java] Space before array initializers.
Before:
new int[]{1, 2, 3, 4};
After:
new int[] {1, 2, 3, 4};
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222640 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTestJava.cpp')
-rw-r--r-- | unittests/Format/FormatTestJava.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/unittests/Format/FormatTestJava.cpp b/unittests/Format/FormatTestJava.cpp index 8c9504b1c1..ba91f1677b 100644 --- a/unittests/Format/FormatTestJava.cpp +++ b/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}"); |