diff options
| author | 2019-06-23 21:36:31 +0000 | |
|---|---|---|
| committer | 2019-06-23 21:36:31 +0000 | |
| commit | 23f101f37937a1bd4a29726cab2f76e0fb038b35 (patch) | |
| tree | f7da7d6b32c2e07114da399150bfa88d72187012 /gnu/llvm/tools/clang/unittests/Format/FormatTestJava.cpp | |
| parent | sort previous; ok deraadt (diff) | |
| download | wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.tar.xz wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.zip | |
Import LLVM 8.0.0 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/tools/clang/unittests/Format/FormatTestJava.cpp')
| -rw-r--r-- | gnu/llvm/tools/clang/unittests/Format/FormatTestJava.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gnu/llvm/tools/clang/unittests/Format/FormatTestJava.cpp b/gnu/llvm/tools/clang/unittests/Format/FormatTestJava.cpp index 76e82612e0f..f12d7fba505 100644 --- a/gnu/llvm/tools/clang/unittests/Format/FormatTestJava.cpp +++ b/gnu/llvm/tools/clang/unittests/Format/FormatTestJava.cpp @@ -155,6 +155,15 @@ TEST_F(FormatTestJava, ClassDeclarations) { " void doStuff(int theStuff);\n" " void doMoreStuff(int moreStuff);\n" "}"); + verifyFormat("class A {\n" + " public @interface SomeInterface {\n" + " int stuff;\n" + " void doMoreStuff(int moreStuff);\n" + " }\n" + "}"); + verifyFormat("class A {\n" + " public @interface SomeInterface {}\n" + "}"); } TEST_F(FormatTestJava, AnonymousClasses) { @@ -443,6 +452,22 @@ TEST_F(FormatTestJava, MethodDeclarations) { getStyleWithColumns(40)); } +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" + "}")); +} + TEST_F(FormatTestJava, CppKeywords) { verifyFormat("public void union(Type a, Type b);"); verifyFormat("public void struct(Object o);"); |
