diff options
author | Nico Weber <nicolasweber@gmx.de> | 2014-11-26 16:43:18 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2014-11-26 16:43:18 +0000 |
commit | 450425c980137ee1e57dd77f149aecaea8300544 (patch) | |
tree | 363a134badda74b41ee75fcd977f57bb923dc4f8 /clang/unittests/Format/FormatTestJava.cpp | |
parent | be6992c7d3d838e278e6c74808f9d0ba01cd17e6 (diff) | |
download | bcm5719-llvm-450425c980137ee1e57dd77f149aecaea8300544.tar.gz bcm5719-llvm-450425c980137ee1e57dd77f149aecaea8300544.zip |
clang-format: Tweak -style=Chromium for Java files.
For Java, don't do any of the deviations from Google Style that Chromium style
does for C++.
Chromium's Java follows Android Java style [1], which is roughly Google Java
style with an indent of 4 and a continuation indent of 8.
1: https://source.android.com/source/code-style.html
llvm-svn: 222839
Diffstat (limited to 'clang/unittests/Format/FormatTestJava.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJava.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJava.cpp b/clang/unittests/Format/FormatTestJava.cpp index b99dec73eef..10149f59b94 100644 --- a/clang/unittests/Format/FormatTestJava.cpp +++ b/clang/unittests/Format/FormatTestJava.cpp @@ -69,6 +69,21 @@ TEST_F(FormatTestJava, FormatsInstanceOfLikeOperators) { Style); } +TEST_F(FormatTestJava, Chromium) { + verifyFormat("class SomeClass {\n" + " void f() {}\n" + " int g() {\n" + " return 0;\n" + " }\n" + " void h() {\n" + " while (true) f();\n" + " for (;;) f();\n" + " if (true) f();\n" + " }\n" + "}", + getChromiumStyle(FormatStyle::LK_Java)); +} + TEST_F(FormatTestJava, ClassKeyword) { verifyFormat("SomeClass.class.getName();"); verifyFormat("Class c = SomeClass.class;"); |