diff options
author | mydeveloperday <mydeveloperday@gmail.com> | 2020-05-02 15:42:20 +0100 |
---|---|---|
committer | mydeveloperday <mydeveloperday@gmail.com> | 2020-05-02 15:42:20 +0100 |
commit | ece7e95f02cdcdf9fa7c6fdfbf6db92e4cc0c87e (patch) | |
tree | 99b891499f27caa1b10fdffb94e3e5f637c4ce15 /clang/unittests/Format/FormatTestJava.cpp | |
parent | d3bc86c2ed579c3b854d37c114a85901ed8cfb9a (diff) | |
download | llvm-ece7e95f02cdcdf9fa7c6fdfbf6db92e4cc0c87e.zip llvm-ece7e95f02cdcdf9fa7c6fdfbf6db92e4cc0c87e.tar.gz llvm-ece7e95f02cdcdf9fa7c6fdfbf6db92e4cc0c87e.tar.bz2 |
[clang-format] NFC - clang-format the FormatTests
Summary:
Ensure the clang-format unit tests are themselves clang-formatted
Having areas of the llvm code which are clang-format clean, give us more areas to run new clang-format binaries on ensuring we haven't broken anything.
It seems to me we SHOULD have this clang-formatted at a minimum, otherwise how can we expect others to use clang-format if we "don't eat our own dogfood", also if the tests are dependent on the formatting of the code then that would also be bad!
Reviewed By: sammccall
Subscribers: cfe-commits
Tags: #clang, #clang-format
Differential Revision: https://reviews.llvm.org/D79204
Diffstat (limited to 'clang/unittests/Format/FormatTestJava.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJava.cpp | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/clang/unittests/Format/FormatTestJava.cpp b/clang/unittests/Format/FormatTestJava.cpp index 5e73e4b..9a18c28 100644 --- a/clang/unittests/Format/FormatTestJava.cpp +++ b/clang/unittests/Format/FormatTestJava.cpp @@ -337,12 +337,12 @@ TEST_F(FormatTestJava, Annotations) { "List<Integer> list;"); verifyFormat( - "@Test\n" - "@Feature({\"Android-TabSwitcher\"})\n" - "@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})\n" - "@Features.EnableFeatures({FEATURE})\n" - "public void test(@Foo.bar(\"baz\") @Quux.Qoob int theFirstParaaaaam,\n" - " @Foo.bar(\"baz\") @Quux.Qoob int theSecondParaaaaaaaaaaaaaaaam) {}"); + "@Test\n" + "@Feature({\"Android-TabSwitcher\"})\n" + "@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})\n" + "@Features.EnableFeatures({FEATURE})\n" + "public void test(@Foo.bar(\"baz\") @Quux.Qoob int theFirstParaaaaam,\n" + " @Foo.bar(\"baz\") @Quux.Qoob int theSecondParaaaaaaaaaaaaaaaam) {}"); } TEST_F(FormatTestJava, Generics) { @@ -460,19 +460,18 @@ TEST_F(FormatTestJava, MethodDeclarations) { } TEST_F(FormatTestJava, MethodReference) { - EXPECT_EQ( - "private void foo() {\n" - " f(this::methodReference);\n" - " f(C.super::methodReference);\n" - " Consumer<String> c = System.out::println;\n" - " Iface<Integer> mRef = Ty::<Integer>meth;\n" - "}", - format("private void foo() {\n" - " f(this ::methodReference);\n" - " f(C.super ::methodReference);\n" - " Consumer<String> c = System.out ::println;\n" - " Iface<Integer> mRef = Ty :: <Integer> meth;\n" - "}")); + EXPECT_EQ("private void foo() {\n" + " f(this::methodReference);\n" + " f(C.super::methodReference);\n" + " Consumer<String> c = System.out::println;\n" + " Iface<Integer> mRef = Ty::<Integer>meth;\n" + "}", + format("private void foo() {\n" + " f(this ::methodReference);\n" + " f(C.super ::methodReference);\n" + " Consumer<String> c = System.out ::println;\n" + " Iface<Integer> mRef = Ty :: <Integer> meth;\n" + "}")); } TEST_F(FormatTestJava, CppKeywords) { @@ -575,16 +574,15 @@ TEST_F(FormatTestJava, KeepsDelimitersOnOwnLineInJavaDocComments) { } TEST_F(FormatTestJava, RetainsLogicalShifts) { - verifyFormat("void f() {\n" - " int a = 1;\n" - " a >>>= 1;\n" - "}"); - verifyFormat("void f() {\n" - " int a = 1;\n" - " a = a >>> 1;\n" - "}"); + verifyFormat("void f() {\n" + " int a = 1;\n" + " a >>>= 1;\n" + "}"); + verifyFormat("void f() {\n" + " int a = 1;\n" + " a = a >>> 1;\n" + "}"); } - -} // end namespace tooling +} // namespace format } // end namespace clang |