Browse Source

Remove more outcommented code

Joeri Exelmans 3 years ago
parent
commit
e707859d98
2 changed files with 1 additions and 78 deletions
  1. 0 78
      src/onion/micro_op.test.ts
  2. 1 0
      src/onion/micro_op.ts

+ 0 - 78
src/onion/micro_op.test.ts

@@ -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");
-  // });
-
 });

+ 1 - 0
src/onion/micro_op.ts

@@ -118,6 +118,7 @@ export class NodeDeletion implements Delta {
   }
 }
 
+// Common functionality in EdgeCreation and EdgeUpdate: both set the target of an edge, and this can conflict with the deletion of the target.
 class SetsTarget {
   readonly edgeOperation: EdgeCreation | EdgeUpdate