diff options
| author | Daniel Jasper <djasper@google.com> | 2015-10-07 04:06:10 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2015-10-07 04:06:10 +0000 |
| commit | 55bbe664bd13fdfe1ba5d9d1600e1b3075b3847c (patch) | |
| tree | a9f6d8b8e0690dd6db412436c5f4c36d340c867d /clang/unittests/Format | |
| parent | e782f673a88b0decbba4a25c5572f3a1ffeb7725 (diff) | |
| download | bcm5719-llvm-55bbe664bd13fdfe1ba5d9d1600e1b3075b3847c.tar.gz bcm5719-llvm-55bbe664bd13fdfe1ba5d9d1600e1b3075b3847c.zip | |
Make clang-format actually respect custom brace wrapping flags.
This fixes llvm.org/PR25073.
llvm-svn: 249519
Diffstat (limited to 'clang/unittests/Format')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 13 |
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) { |

