MCPcopy
hub / github.com/dgraph-io/dgraph / populateClusterGraph

Function populateClusterGraph

worker/worker_test.go:130–142  ·  view source on GitHub ↗
(t *testing.T, dg *dgo.Dgraph)

Source from the content-addressed store, hash-verified

128}
129
130func populateClusterGraph(t *testing.T, dg *dgo.Dgraph) {
131 data1 := [][]int{{10, 23}, {11, 23}, {12, 23}, {12, 25}, {12, 26}, {10, 31}, {12, 31}}
132 for _, pair := range data1 {
133 rdf := fmt.Sprintf(`<%#x> <neighbour> <%#x> .`, pair[0], pair[1])
134 setClusterEdge(t, dg, rdf)
135 }
136
137 data2 := map[int]string{12: "photon", 10: "photon"}
138 for key, val := range data2 {
139 rdf := fmt.Sprintf(`<%#x> <friend> %q .`, key, val)
140 setClusterEdge(t, dg, rdf)
141 }
142}
143
144func initTest(t *testing.T, schemaStr string) {
145 err := schema.ParseBytes([]byte(schemaStr), 1)

Callers 1

initClusterTestFunction · 0.85

Calls 1

setClusterEdgeFunction · 0.70

Tested by

no test coverage detected