MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / TestMultiPartListWithPostings

Function TestMultiPartListWithPostings

posting/list_test.go:1308–1324  ·  view source on GitHub ↗

Verify that postings can be retrieved in multi-part lists.

(t *testing.T)

Source from the content-addressed store, hash-verified

1306
1307// Verify that postings can be retrieved in multi-part lists.
1308func TestMultiPartListWithPostings(t *testing.T) {
1309 size := int(1e5)
1310 ol, commits := createMultiPartList(t, size, true)
1311
1312 var facets []string
1313 err := ol.Iterate(uint64(size)+1, 0, func(p *pb.Posting) error {
1314 if len(p.Facets) > 0 {
1315 facets = append(facets, p.Facets[0].Key)
1316 }
1317 return nil
1318 })
1319 require.NoError(t, err)
1320 require.Equal(t, commits, len(facets))
1321 for i, facet := range facets {
1322 require.Equal(t, facet, strconv.Itoa(i+1))
1323 }
1324}
1325
1326// Verify marshaling of multi-part lists.
1327func TestMultiPartListMarshal(t *testing.T) {

Callers

nothing calls this directly

Calls 2

createMultiPartListFunction · 0.85
IterateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…