MCPcopy Create free account
hub / github.com/encodeous/nylon / TestParseGraph_Groups

Function TestParseGraph_Groups

state/config_test.go:26–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24}
25
26func TestParseGraph_Groups(t *testing.T) {
27 nodes := []string{"1", "2", "3", "4", "5", "6", "7"}
28 input := `a = 1,2
29b=3,,,4
30c=5,6
31d=a,b
32d,d
337,d`
34 pairs, err := ParseGraph(strings.Split(input, "\n"), nodes)
35 assert.NoError(t, err)
36 assert.ElementsMatch(t, pairs, []Pair[NodeId, NodeId]{
37 // d,d
38 {"1", "2"},
39 {"1", "3"},
40 {"1", "4"},
41 {"2", "3"},
42 {"2", "4"},
43 {"3", "4"},
44 // 7,d
45 {"1", "7"},
46 {"2", "7"},
47 {"3", "7"},
48 {"4", "7"},
49 })
50}
51
52func TestParseGraph_Cycle(t *testing.T) {
53 nodes := []string{}

Callers

nothing calls this directly

Calls 1

ParseGraphFunction · 0.85

Tested by

no test coverage detected