MCPcopy Create free account
hub / github.com/Effect-TS/tsgo / buildChainGraph

Function buildChainGraph

internal/graph/graph_test.go:25–33  ·  view source on GitHub ↗

buildChainGraph creates: A→B→C

()

Source from the content-addressed store, hash-verified

23
24// buildChainGraph creates: A→B→C
25func buildChainGraph() (*Graph[string, string], [3]NodeIndex) {
26 g := New[string, string]()
27 a := g.AddNode("A")
28 b := g.AddNode("B")
29 c := g.AddNode("C")
30 g.AddEdge(a, b, "ab")
31 g.AddEdge(b, c, "bc")
32 return g, [3]NodeIndex{a, b, c}
33}
34
35// collectValues collects the values from an iter.Seq2 into a slice.
36func collectValues[K comparable, V any](seq iter.Seq2[K, V]) []V {

Callers 4

TestDFSFunction · 0.85
TestDFSPostOrderFunction · 0.85
TestBFSFunction · 0.85
TestTopoFunction · 0.85

Calls 3

AddNodeMethod · 0.80
AddEdgeMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected