From 3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 Mon Sep 17 00:00:00 2001 From: dim Date: Wed, 27 May 2015 18:47:56 +0000 Subject: Vendor import of clang trunk r238337: https://llvm.org/svn/llvm-project/cfe/trunk@238337 --- unittests/Format/FormatTestJava.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'unittests/Format/FormatTestJava.cpp') 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)); } -- cgit v1.1