summaryrefslogtreecommitdiffstats
path: root/unittests/Format/FormatTestJava.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-05-27 18:47:56 +0000
committerdim <dim@FreeBSD.org>2015-05-27 18:47:56 +0000
commit3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 (patch)
treedbbd4047878da71c1a706e26ce05b4e7791b14cc /unittests/Format/FormatTestJava.cpp
parent38d6f2e7f2ce51a5b3836d26596c6c34a3288752 (diff)
downloadFreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.zip
FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.tar.gz
Vendor import of clang trunk r238337:
https://llvm.org/svn/llvm-project/cfe/trunk@238337
Diffstat (limited to 'unittests/Format/FormatTestJava.cpp')
-rw-r--r--unittests/Format/FormatTestJava.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/unittests/Format/FormatTestJava.cpp b/unittests/Format/FormatTestJava.cpp
index 8d6daa6..631a3dc 100644
--- a/unittests/Format/FormatTestJava.cpp
+++ b/unittests/Format/FormatTestJava.cpp
@@ -153,6 +153,19 @@ TEST_F(FormatTestJava, ClassDeclarations) {
"}");
}
+TEST_F(FormatTestJava, AnonymousClasses) {
+ verifyFormat("return new A() {\n"
+ " public String toString() {\n"
+ " return \"NotReallyA\";\n"
+ " }\n"
+ "};");
+ verifyFormat("A a = new A() {\n"
+ " public String toString() {\n"
+ " return \"NotReallyA\";\n"
+ " }\n"
+ "};");
+}
+
TEST_F(FormatTestJava, EnumDeclarations) {
verifyFormat("enum SomeThing { ABC, CDE }");
verifyFormat("enum SomeThing {\n"
@@ -420,7 +433,7 @@ TEST_F(FormatTestJava, NeverAlignAfterReturn) {
getStyleWithColumns(40));
verifyFormat("return aaaaaaaaaaaaaaaaaaa()\n"
" .bbbbbbbbbbbbbbbbbbb(\n"
- " ccccccccccccccc)\n"
+ " ccccccccccccccc)\n"
" .ccccccccccccccccccc();",
getStyleWithColumns(40));
}
OpenPOWER on IntegriCloud