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

Function TestIntersectCompressedWithLinJump

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

Source from the content-addressed store, hash-verified

605}
606
607func TestIntersectCompressedWithLinJump(t *testing.T) {
608 lengths := []int{0, 1, 3, 11, 100}
609
610 for _, N1 := range lengths {
611 for _, N2 := range lengths {
612 // Intersection of blockNums and otherNums is commonNums.
613 commonNums, blockNums, otherNums := fillNums(N1, N2)
614
615 enc := codec.Encoder{BlockSize: 10}
616 for _, num := range blockNums {
617 enc.Add(num)
618 }
619
620 pack := enc.Done()
621 dec := codec.Decoder{Pack: pack}
622 dec.Seek(0, codec.SeekStart)
623
624 actual := make([]uint64, 0)
625 IntersectCompressedWithLinJump(&dec, otherNums, &actual)
626 require.Equal(t, commonNums, actual)
627 codec.FreePack(pack)
628 }
629 }
630}
631
632func TestIntersectCompressedWithBin(t *testing.T) {
633 //lengths := []int{0, 1, 3, 11, 100, 500, 1000}

Callers

nothing calls this directly

Calls 6

AddMethod · 0.95
DoneMethod · 0.95
SeekMethod · 0.95
FreePackFunction · 0.92
fillNumsFunction · 0.85

Tested by

no test coverage detected