summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Tooling/RewriterTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Tooling/RewriterTest.cpp')
-rw-r--r--clang/unittests/Tooling/RewriterTest.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/unittests/Tooling/RewriterTest.cpp b/clang/unittests/Tooling/RewriterTest.cpp
index e8afedb0117..4305d421e1c 100644
--- a/clang/unittests/Tooling/RewriterTest.cpp
+++ b/clang/unittests/Tooling/RewriterTest.cpp
@@ -39,8 +39,11 @@ TEST(Rewriter, ContinuesOverwritingFilesOnError) {
TEST(Rewriter, AdjacentInsertAndDelete) {
Replacements Replaces;
- Replaces.insert(Replacement("<file>", 6, 6, ""));
- Replaces.insert(Replacement("<file>", 6, 0, "replaced\n"));
+ auto Err = Replaces.add(Replacement("<file>", 6, 6, ""));
+ EXPECT_TRUE(!Err);
+ Replaces =
+ Replaces.merge(Replacements(Replacement("<file>", 6, 0, "replaced\n")));
+
auto Rewritten = applyAllReplacements("line1\nline2\nline3\nline4", Replaces);
EXPECT_TRUE(static_cast<bool>(Rewritten));
EXPECT_EQ("line1\nreplaced\nline3\nline4", *Rewritten);
OpenPOWER on IntegriCloud