MCPcopy Create free account
hub / github.com/Effect-TS/effect / makeGraph

Function makeGraph

packages/effect/test/Graph.test.ts:109–119  ·  view source on GitHub ↗
(
      type: Graph.Kind,
      edges: ReadonlyArray<readonly [Graph.NodeIndex, Graph.NodeIndex, string]>
    )

Source from the content-addressed store, hash-verified

107
108 describe("equality and hashing", () => {
109 const makeGraph = (
110 type: Graph.Kind,
111 edges: ReadonlyArray<readonly [Graph.NodeIndex, Graph.NodeIndex, string]>
112 ) =>
113 Graph.make(type)<string, string>((mutable) => {
114 Graph.addNode(mutable, "A")
115 Graph.addNode(mutable, "B")
116 for (const [source, target, data] of edges) {
117 Graph.addEdge(mutable, source, target, data)
118 }
119 })
120
121 it("treats undirected edge endpoints as unordered", () => {
122 const left = makeGraph("undirected", [[0, 1, "edge"]])

Callers 1

Graph.test.tsFile · 0.85

Calls 1

makeMethod · 0.65

Tested by

no test coverage detected