diff options
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index c6f1c8e4ec..eb00d017ff 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -1184,7 +1184,8 @@ TEST_F(FormatTest, HandlesIncludeDirectives) { "#include \"a/b/string\"\n" "#include \"string.h\"\n" "#include \"string.h\"\n" - "#include <a-a>"); + "#include <a-a>\n" + "#include < path with space >\n"); verifyFormat("#import <string>"); verifyFormat("#import <a/b/c.h>"); @@ -1334,6 +1335,13 @@ TEST_F(FormatTest, UnderstandContextOfRecordTypeKeywords) { " f();\n"); } +TEST_F(FormatTest, DoNotInterfereWithErrorAndWarning) { + verifyFormat("#error Leave all white!!!!! space* alone!\n"); + verifyFormat("#warning Leave all white!!!!! space* alone!\n"); + EXPECT_EQ("#error 1", format(" # error 1")); + EXPECT_EQ("#warning 1", format(" # warning 1")); +} + // FIXME: This breaks the order of the unwrapped lines: // TEST_F(FormatTest, OrderUnwrappedLines) { // verifyFormat("{\n" |