aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index c3fef1d401..2a2bb3fe6d 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -274,6 +274,32 @@ TEST_F(FormatTest, FormatsSwitchStatement) {
" break;\n"
"}\n"
"}");
+ verifyFormat("switch (x) {\n"
+ "case 1: {\n"
+ " f();\n"
+ " {\n"
+ " g();\n"
+ " h();\n"
+ " }\n"
+ " break;\n"
+ "}\n"
+ "}");
+ verifyFormat("switch (x) {\n"
+ "case 1: {\n"
+ " f();\n"
+ " if (foo) {\n"
+ " g();\n"
+ " h();\n"
+ " }\n"
+ " break;\n"
+ "}\n"
+ "}");
+ verifyFormat("switch (x) {\n"
+ "case 1: {\n"
+ " f();\n"
+ " g();\n"
+ "} break;\n"
+ "}");
verifyFormat("switch (test)\n"
" ;");
verifyGoogleFormat("switch (x) {\n"