Added some tests for PatchBuilder replaceInsert #280
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the current situation of the
b3_0
sources, it looks like there are no tests for the straight replaceInsert functionality of the patch builder (EDIT: there seems to be one test undertest-complete
directory calledTestPartialUpdate
which replace/inserts on array elements). In a recent project I found out, that the behavior of the patch builder does differ if the node does exist (replace) vs. if does not yet exist (insert: will put the whole fragment instead of the selectPath). This behavior is for the application developer a bit inconvenient, since you have to check first wether the node does exist or not, and then to decide how you structure the fragment node in question.NOTE: Therefore this test case highlights the current problem and the second assertion (L. 357, "please make me not nested") will fail.