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.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index a2f150d186..a0cfeee90b 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -1114,8 +1114,12 @@ TEST_F(FormatTest, IncorrectCodeDoNoWhile) {
"}");
}
-TEST_F(FormatTest, IncorrectIf) {
+TEST_F(FormatTest, IncorrectCodeMissingParens) {
verifyFormat("if {\n foo;\n foo();\n}");
+ verifyFormat("switch {\n foo;\n foo();\n}");
+ verifyFormat("for {\n foo;\n foo();\n}");
+ verifyFormat("while {\n foo;\n foo();\n}");
+ verifyFormat("do {\n foo;\n foo();\n} while;");
}
TEST_F(FormatTest, DoesNotTouchUnwrappedLinesWithErrors) {