|
@@ -143,11 +143,15 @@ describe("Primitive Delta", () => {
|
|
|
const newTargetCreation = registry.newNodeCreation(getId()); // no conflict
|
|
|
const edgeUpdate = registry.newEdgeUpdate(edgeCreation.overwrite(), new TargetNode(newTargetCreation));
|
|
|
|
|
|
- console.log("edgeUpdate.conflictsWith", edgeUpdate.conflictsWith, "edgeDeletion.conflictsWith", edgeDeletion.conflictsWith);
|
|
|
+ // console.log("edgeUpdate.conflictsWith", edgeUpdate.conflictsWith, "edgeDeletion.conflictsWith", edgeDeletion.conflictsWith);
|
|
|
|
|
|
|
|
|
- assert(edgeUpdate.conflictsWith.length === 1, "expected U/U conflict");
|
|
|
+ assert(edgeUpdate.conflictsWith.length === 2, "expected U/U conflict");
|
|
|
+ assert(edgeUpdate.conflictsWith.some(([d])=>d===edgeDeletion), "expected U/U conflict");
|
|
|
+ assert(edgeUpdate.conflictsWith.some(([d])=>d===sourceDeletion), "expected U/U conflict");
|
|
|
+
|
|
|
assert(edgeDeletion.conflictsWith.length === 1, "expected U/U conflict");
|
|
|
+ assert(edgeDeletion.conflictsWith.some(([d])=>d===edgeUpdate), "expected U/U conflict");
|
|
|
});
|
|
|
|
|
|
it("Delete/require (edge target) conflict", () => {
|
|
@@ -160,6 +164,7 @@ describe("Primitive Delta", () => {
|
|
|
const targetDeletion = registry.newNodeDeletion(targetCreation, [], []);
|
|
|
|
|
|
const edgeCreation = registry.newEdgeUpdate(sourceCreation.createOutgoingEdge("label"), new TargetNode(targetCreation));
|
|
|
+
|
|
|
assert(edgeCreation.conflictsWith.length === 1, "expected require/delete conflict");
|
|
|
assert(targetDeletion.conflictsWith.length === 1, "expected require/delete conflict");
|
|
|
});
|
|
@@ -219,8 +224,8 @@ describe("Primitive Delta", () => {
|
|
|
|
|
|
const nodeCreation = registry.newNodeCreation(getId());
|
|
|
const edgeCreation = registry.newEdgeUpdate(nodeCreation.createOutgoingEdge("label"), new TargetNode(nodeCreation));
|
|
|
- const edgeUpdate = registry.newEdgeUpdate(edgeCreation.overwrite(), new TargetValue(null));
|
|
|
- const nodeDeletion = registry.newNodeDeletion(nodeCreation, [edgeUpdate], [edgeUpdate]);
|
|
|
+ const edgeDeletion = registry.newEdgeUpdate(edgeCreation.overwrite(), new TargetValue(null));
|
|
|
+ const nodeDeletion = registry.newNodeDeletion(nodeCreation, [edgeDeletion], [edgeDeletion]);
|
|
|
|
|
|
// console.log(nodeDeletion.conflictsWith);
|
|
|
assert(nodeDeletion.conflictsWith.length === 0, "expected no conflicts");
|