diff options
author | Manuel Klimek <klimek@google.com> | 2013-01-11 19:23:05 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2013-01-11 19:23:05 +0000 |
commit | 6eca03fcac1e408470d48e6309a280d3681f717d (patch) | |
tree | e10c31ca7b055bc95eb2a16d764fc208568a024f /unittests/Format/FormatTest.cpp | |
parent | d5688cf3e314819ca196053ac245c19a7c321332 (diff) |
Fix crashes in UnwrappedLineParser on missing parens.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172239 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 6 |
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) { |