aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/FormatTestJava.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Format/FormatTestJava.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJava.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJava.cpp b/clang/unittests/Format/FormatTestJava.cpp
index 84f6420..e778836e 100644
--- a/clang/unittests/Format/FormatTestJava.cpp
+++ b/clang/unittests/Format/FormatTestJava.cpp
@@ -602,5 +602,16 @@ TEST_F(FormatTestJava, RetainsLogicalShifts) {
"}");
}
+TEST_F(FormatTestJava, ShortFunctions) {
+ FormatStyle Style = getLLVMStyle(FormatStyle::LK_Java);
+ Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline;
+ verifyFormat("enum Enum {\n"
+ " E1,\n"
+ " E2;\n"
+ " void f() { return; }\n"
+ "}",
+ Style);
+}
+
} // namespace format
} // end namespace clang