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.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 62ce4c33ac..df93fbd05a 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -708,6 +708,15 @@ TEST_F(FormatTest, SplitsLongCxxComments) {
getLLVMStyleWithColumns(20)));
}
+TEST_F(FormatTest, ParsesCommentsAdjacentToPPDirectives) {
+ EXPECT_EQ("namespace {}\n// Test\n#define A",
+ format("namespace {}\n // Test\n#define A"));
+ EXPECT_EQ("namespace {}\n/* Test */\n#define A",
+ format("namespace {}\n /* Test */\n#define A"));
+ EXPECT_EQ("namespace {}\n/* Test */ #define A",
+ format("namespace {}\n /* Test */ #define A"));
+}
+
TEST_F(FormatTest, SplitsLongLinesInComments) {
EXPECT_EQ("/* This is a long\n"
" * comment that\n"