MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / subgraphWithSingleResultAndSingleValue

Function subgraphWithSingleResultAndSingleValue

query/fastjson_test.go:21–41  ·  view source on GitHub ↗
(val *pb.TaskValue)

Source from the content-addressed store, hash-verified

19)
20
21func subgraphWithSingleResultAndSingleValue(val *pb.TaskValue) *SubGraph {
22 return &SubGraph{
23 Params: params{Alias: "query"},
24 SrcUIDs: &pb.List{Uids: []uint64{1}},
25 DestUIDs: &pb.List{Uids: []uint64{1}},
26 uidMatrix: []*pb.List{{Uids: []uint64{1}}},
27 Children: []*SubGraph{
28 {
29 Attr: "val",
30 SrcUIDs: &pb.List{Uids: []uint64{1}},
31 uidMatrix: []*pb.List{{}},
32 valueMatrix: []*pb.ValueList{
33 // UID 1
34 {
35 Values: []*pb.TaskValue{val},
36 },
37 },
38 },
39 },
40 }
41}
42
43func assertJSON(t *testing.T, expected string, sg *SubGraph) {
44 buf, err := ToJson(context.Background(), &Latency{}, []*SubGraph{sg}, nil)

Callers 1

TestSubgraphToFastJSONFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected