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

Function TestMergeSortedRandom

algo/uidlist_test.go:109–127  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

107}
108
109func TestMergeSortedRandom(t *testing.T) {
110 createList := func(n int) *pb.List {
111 list := make([]uint64, n)
112 for i := range list {
113 list[i] = uint64(rand.Int63())
114 }
115 sort.Slice(list, func(i, j int) bool {
116 return list[i] < list[j]
117 })
118 return &pb.List{Uids: list}
119 }
120
121 input := []*pb.List{}
122 for i := 0; i < 1000; i++ {
123 input = append(input, createList(1000))
124 }
125
126 require.Equal(t, MergeSorted(input).Uids, internalMergeSort(input).Uids)
127}
128
129func TestMergeSorted7(t *testing.T) {
130 input := []*pb.List{

Callers

nothing calls this directly

Calls 4

MergeSortedFunction · 0.85
internalMergeSortFunction · 0.85
Int63Method · 0.80
SliceMethod · 0.80

Tested by

no test coverage detected