summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index ff9d2d473ff..00f87ba9515 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -2332,8 +2332,8 @@ TEST_F(FormatTest, IncompleteTryCatchBlocks) {
TEST_F(FormatTest, FormatTryCatchBraceStyles) {
FormatStyle Style = getLLVMStyle();
- for (auto BraceStyle :
- {FormatStyle::BS_Attach, FormatStyle::BS_Mozilla, FormatStyle::BS_WebKit}) {
+ for (auto BraceStyle : {FormatStyle::BS_Attach, FormatStyle::BS_Mozilla,
+ FormatStyle::BS_WebKit}) {
Style.BreakBeforeBraces = BraceStyle;
verifyFormat("try {\n"
" // something\n"
@@ -2384,6 +2384,15 @@ TEST_F(FormatTest, FormatTryCatchBraceStyles) {
" // something\n"
" }",
Style);
+ Style.BreakBeforeBraces = FormatStyle::BS_Custom;
+ Style.BraceWrapping.BeforeCatch = true;
+ verifyFormat("try {\n"
+ " // something\n"
+ "}\n"
+ "catch (...) {\n"
+ " // something\n"
+ "}",
+ Style);
}
TEST_F(FormatTest, FormatObjCTryCatch) {
OpenPOWER on IntegriCloud