|
@@ -7,8 +7,6 @@ import {
|
|
|
NodeDeletion,
|
|
|
EdgeCreation,
|
|
|
EdgeUpdate,
|
|
|
- // EdgeDeletion,
|
|
|
- // DeltaGraph,
|
|
|
} from "./micro_op";
|
|
|
|
|
|
let nextId = 0;
|
|
@@ -167,80 +165,4 @@ describe("Delta", () => {
|
|
|
assert(targetDeletion.getConflicts().length === 0, "expected no require/delete conflict");
|
|
|
})
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- // it("Delete/delete conflict", () => {
|
|
|
- // const deltaGraph = new DeltaGraph();
|
|
|
-
|
|
|
- // const nodeCreation = deltaGraph.newNodeCreation(getId());
|
|
|
-
|
|
|
- // (() => {
|
|
|
- // const [_, delDel, delReq] = deltaGraph.newNodeDeletion(nodeCreation, []);
|
|
|
- // assert(delDel.length === 0, "did not expect DEL/DEL conflict");
|
|
|
- // assert(delReq.length === 0, "did not expect DEL/REQ conflict");
|
|
|
- // })();
|
|
|
-
|
|
|
- // (() => {
|
|
|
- // const [_, delDel, delReq] = deltaGraph.newNodeDeletion(nodeCreation, []);
|
|
|
- // assert(delDel.length === 1, "expected DEL/DEL conflict");
|
|
|
- // assert(delReq.length === 0, "did not expect DEL/REQ conflict");
|
|
|
- // })();
|
|
|
- // });
|
|
|
-
|
|
|
- // it("Delete/require conflict", () => {
|
|
|
- // const deltaGraph = new DeltaGraph();
|
|
|
-
|
|
|
- // const sourceCreation = deltaGraph.newNodeCreation(getId());
|
|
|
- // const targetCreation = deltaGraph.newNodeCreation(getId());
|
|
|
-
|
|
|
- // const [edgeCreation, edgeCreate, delReq] = deltaGraph.newEdgeCreation(sourceCreation, "label", targetCreation);
|
|
|
- // assert(edgeCreate.length === 0, "did not expect edge creation conflict");
|
|
|
- // assert(delReq.length === 0, "did not expect DEL/REQ conflict");
|
|
|
-
|
|
|
- // // Source and target are deleted, unaware of the fact that there was an edge
|
|
|
- // // This results in a DEL/REQ conflict
|
|
|
- // (() => {
|
|
|
- // const [_, delDel, delReq] = deltaGraph.newNodeDeletion(sourceCreation, []);
|
|
|
- // assert(delDel.length === 0, "did not expect DEL/DEL conflict");
|
|
|
- // assert(delReq.length === 1, "expected DEL/REQ conflict");
|
|
|
- // })();
|
|
|
-
|
|
|
- // (() => {
|
|
|
- // const [_, delDel, delReq] = deltaGraph.newNodeDeletion(targetCreation, []);
|
|
|
- // assert(delDel.length === 0, "did not expect DEL/DEL conflict");
|
|
|
- // assert(delReq.length === 1, "expected DEL/REQ conflict");
|
|
|
- // })();
|
|
|
-
|
|
|
- // // Part two - edge is deleted
|
|
|
- // const [edgeDeletion, edgeConflicts] = deltaGraph.newEdgeDeletion(edgeCreation);
|
|
|
- // assert(edgeConflicts.length === 0, "did not expect edge update conflicts");
|
|
|
-
|
|
|
- // // Deletions that depend on the edge deletion do not cause a DEL/REQ conflict
|
|
|
- // (() => {
|
|
|
- // const [_, delDel, delReq] = deltaGraph.newNodeDeletion(sourceCreation, [edgeDeletion]);
|
|
|
- // assert(delDel.length === 1, "expected DEL/DEL conflict");
|
|
|
- // assert(delReq.length === 0, "did not expect DEL/REQ conflict");
|
|
|
- // })();
|
|
|
-
|
|
|
- // (() => {
|
|
|
- // const [_, delDel, delReq] = deltaGraph.newNodeDeletion(targetCreation, [edgeDeletion]);
|
|
|
- // assert(delDel.length === 1, "expected DEL/DEL conflict");
|
|
|
- // assert(delReq.length === 0, "did not expect DEL/REQ conflict");
|
|
|
- // })();
|
|
|
- // });
|
|
|
-
|
|
|
- // it("Delete/require conflict (2)", () => {
|
|
|
- // const deltaGraph = new DeltaGraph();
|
|
|
-
|
|
|
- // const sourceCreation = deltaGraph.newNodeCreation(getId());
|
|
|
- // const targetCreation = deltaGraph.newNodeCreation(getId());
|
|
|
-
|
|
|
- // const sourceDeletion = deltaGraph.newNodeDeletion(sourceCreation, []);
|
|
|
- // const targetDeletion = deltaGraph.newNodeDeletion(sourceCreation, []);
|
|
|
-
|
|
|
- // // Edge creation is unaware that source and target are concurrently being deleted.
|
|
|
- // const [edgeCreation, edgeCreate, delReq] = deltaGraph.newEdgeCreation(sourceCreation, "label", targetCreation);
|
|
|
- // assert(delReq.length === 2, "expected 2 DEL/REQ conflicts");
|
|
|
- // });
|
|
|
-
|
|
|
});
|