diff --git a/src/lib/diff/test-mutation-target.hpp b/src/lib/diff/test-mutation-target.hpp index b0ee081f2..d4b01c092 100644 --- a/src/lib/diff/test-mutation-target.hpp +++ b/src/lib/diff/test-mutation-target.hpp @@ -217,6 +217,12 @@ namespace diff{ return content_.empty(); } + bool + emptySrc() const + { + return prev_content_.empty(); + } + /** check for recorded element */ bool contains (string spec) const diff --git a/src/lib/diff/tree-diff-mutator-binding.hpp b/src/lib/diff/tree-diff-mutator-binding.hpp index 8f313baba..adc2669e6 100644 --- a/src/lib/diff/tree-diff-mutator-binding.hpp +++ b/src/lib/diff/tree-diff-mutator-binding.hpp @@ -291,15 +291,9 @@ namespace diff{ /* == Forwarding: mutation primitives == */ void - skipSrc (GenNode const& n) + skipSrc() { - UNIMPLEMENTED("skip matching src element and advance abstract source position"); - } - - void - acceptSrc (GenNode const& n) - { - UNIMPLEMENTED("accept existing element"); + UNIMPLEMENTED("skip next src element and advance abstract source position"); } void @@ -308,6 +302,18 @@ namespace diff{ UNIMPLEMENTED("inject a new element at current abstract position"); } + bool + matchSrc (GenNode const& n) + { + UNIMPLEMENTED("ensure the next source element matches with given spec"); + } + + bool + acceptSrc (GenNode const& n) + { + UNIMPLEMENTED("accept existing element, when matching the given spec"); + } + bool findSrc (GenNode const& n) { @@ -352,7 +358,7 @@ namespace diff{ del (GenNode const& n) override { __expect_in_target(n, "remove"); - skipSrc (n); + skipSrc(); } virtual void @@ -366,7 +372,7 @@ namespace diff{ skip (GenNode const& n) override { __expect_further_elements (n); - skipSrc (n); + skipSrc(); } // assume the actual content has been moved away by a previous find() virtual void diff --git a/src/lib/diff/tree-mutator.hpp b/src/lib/diff/tree-mutator.hpp index 91f59d94b..de919f96d 100644 --- a/src/lib/diff/tree-mutator.hpp +++ b/src/lib/diff/tree-mutator.hpp @@ -121,22 +121,34 @@ namespace diff{ /* ==== operation API ==== */ + virtual void + skipSrc () + { + UNIMPLEMENTED("skip next src element and advance abstract source position"); + } + virtual void injectNew (GenNode const& n) { UNIMPLEMENTED("establish new child node at current position"); } - virtual void - deleteChild (ID id) + virtual bool + matchSrc (GenNode const& n) { - UNIMPLEMENTED("destroy child node at current position"); + UNIMPLEMENTED("ensure the next source element matches with given spec"); } - virtual void - findChild (ID id) + virtual bool + acceptSrc (GenNode const& n) { - UNIMPLEMENTED("look ahead, find and retrieve denoted child to be relocated at current position"); + UNIMPLEMENTED("accept existing element, when matching the given spec"); + } + + virtual bool + findSrc (GenNode const& n) + { + UNIMPLEMENTED("locate designated element and accept it at current position"); } virtual TreeMutator& diff --git a/tests/library/diff/tree-manipulation-binding-test.cpp b/tests/library/diff/tree-manipulation-binding-test.cpp index 79c8fd35e..92a2ff3f4 100644 --- a/tests/library/diff/tree-manipulation-binding-test.cpp +++ b/tests/library/diff/tree-manipulation-binding-test.cpp @@ -142,51 +142,50 @@ namespace test{ << join(target) <