diff options
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 8d95538b16..28f63aa055 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -474,8 +474,12 @@ TEST_F(FormatTest, FormatHashIfNotAtStartOfLine) { verifyFormat("{\n {\n a #c;\n }\n}"); } -// FIXME: write test for unbalanced braces in macros... -// FIXME: test # inside a normal statement (like {#define A b}) +TEST_F(FormatTest, FormatUnbalancedStructuralElements) { + EXPECT_EQ("#define A \\\n { \\\n {\nint i;", + format("#define A { {\nint i;", getLLVMStyleWithColumns(11))); + EXPECT_EQ("#define A \\\n } \\\n }\nint i;", + format("#define A } }\nint i;", getLLVMStyleWithColumns(11))); +} TEST_F(FormatTest, MixingPreprocessorDirectivesAndNormalCode) { EXPECT_EQ( |