| 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"]]) |