diff options
author | Eric Liu <ioeric@google.com> | 2016-05-27 08:20:02 +0000 |
---|---|---|
committer | Eric Liu <ioeric@google.com> | 2016-05-27 08:20:02 +0000 |
commit | 1ef68456cff73736256b923b0b0cd2cfd7f8ce43 (patch) | |
tree | 87de4da59f6263b36ce421db36af1a2d044dd90b /clang/unittests/Format/FormatTest.cpp | |
parent | 32578b7dcf80e92d414a2f70d86a52d783a5e457 (diff) | |
download | bcm5719-llvm-1ef68456cff73736256b923b0b0cd2cfd7f8ce43.tar.gz bcm5719-llvm-1ef68456cff73736256b923b0b0cd2cfd7f8ce43.zip |
[clang-format] moved unit tests related to replacements cleaner from FormatTest.cpp to CleanUpTest.cpp.
llvm-svn: 270971
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 27379b7d6c7..5effc3162f7 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -11537,35 +11537,6 @@ TEST_F(ReplacementTest, FormatCodeAfterReplacements) { Code, formatReplacements(Code, Replaces, Style))); } -TEST_F(ReplacementTest, FixOnlyAffectedCodeAfterReplacements) { - std::string Code = "namespace A {\n" - "namespace B {\n" - " int x;\n" - "} // namespace B\n" - "} // namespace A\n" - "\n" - "namespace C {\n" - "namespace D { int i; }\n" - "inline namespace E { namespace { int y; } }\n" - "int x= 0;" - "}"; - std::string Expected = "\n\nnamespace C {\n" - "namespace D { int i; }\n\n" - "int x= 0;" - "}"; - FileID ID = Context.createInMemoryFile("fix.cpp", Code); - tooling::Replacements Replaces; - Replaces.insert(tooling::Replacement( - Context.Sources, Context.getLocation(ID, 3, 3), 6, "")); - Replaces.insert(tooling::Replacement( - Context.Sources, Context.getLocation(ID, 9, 34), 6, "")); - - format::FormatStyle Style = format::getLLVMStyle(); - auto FinalReplaces = formatReplacements( - Code, cleanupAroundReplacements(Code, Replaces, Style), Style); - EXPECT_EQ(Expected, applyAllReplacements(Code, FinalReplaces)); -} - TEST_F(ReplacementTest, SortIncludesAfterReplacement) { std::string Code = "#include \"a.h\"\n" "#include \"c.h\"\n" |