diff options
Diffstat (limited to 'clang/unittests/Format/FormatTestJava.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJava.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJava.cpp b/clang/unittests/Format/FormatTestJava.cpp index 9a18c28..84f6420 100644 --- a/clang/unittests/Format/FormatTestJava.cpp +++ b/clang/unittests/Format/FormatTestJava.cpp @@ -431,6 +431,24 @@ TEST_F(FormatTestJava, SynchronizedKeyword) { verifyFormat("synchronized (mData) {\n" " // ...\n" "}"); + + FormatStyle Style = getLLVMStyle(FormatStyle::LK_Java); + Style.BreakBeforeBraces = FormatStyle::BS_Custom; + + Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always; + Style.BraceWrapping.AfterFunction = false; + verifyFormat("synchronized (mData)\n" + "{\n" + " // ...\n" + "}", + Style); + + Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Never; + Style.BraceWrapping.AfterFunction = true; + verifyFormat("synchronized (mData) {\n" + " // ...\n" + "}", + Style); } TEST_F(FormatTestJava, AssertKeyword) { |