diff options
Diffstat (limited to 'clang/unittests/Format/CleanupTest.cpp')
-rw-r--r-- | clang/unittests/Format/CleanupTest.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/unittests/Format/CleanupTest.cpp b/clang/unittests/Format/CleanupTest.cpp index dbf3f070476..6ac5f695d43 100644 --- a/clang/unittests/Format/CleanupTest.cpp +++ b/clang/unittests/Format/CleanupTest.cpp @@ -714,6 +714,19 @@ TEST_F(CleanUpReplacementsTest, IfNDefWithNoDefine) { EXPECT_EQ(Expected, apply(Code, Replaces)); } +TEST_F(CleanUpReplacementsTest, FakeHeaderGuard) { + std::string Code = "// comment \n" + "#ifndef X\n" + "#define 1\n"; + std::string Expected = "// comment \n" + "#include <vector>\n" + "#ifndef X\n" + "#define 1\n"; + tooling::Replacements Replaces = + toReplacements({createInsertion("#include <vector>")}); + EXPECT_EQ(Expected, apply(Code, Replaces)); +} + TEST_F(CleanUpReplacementsTest, HeaderGuardWithComment) { std::string Code = "// comment \n" "#ifndef X // comment\n" |