(t *testing.T)
| 630 | } |
| 631 | |
| 632 | func TestIntersectCompressedWithBin(t *testing.T) { |
| 633 | //lengths := []int{0, 1, 3, 11, 100, 500, 1000} |
| 634 | |
| 635 | for _, N1 := range []int{11} { |
| 636 | for _, N2 := range []int{3} { |
| 637 | // Intersection of blockNums and otherNums is commonNums. |
| 638 | commonNums, blockNums, otherNums := fillNumsDiff(N1/10, N1, N2) |
| 639 | |
| 640 | enc := codec.Encoder{BlockSize: 10} |
| 641 | for _, num := range blockNums { |
| 642 | enc.Add(num) |
| 643 | } |
| 644 | |
| 645 | pack := enc.Done() |
| 646 | dec := codec.Decoder{Pack: pack} |
| 647 | dec.Seek(0, codec.SeekStart) |
| 648 | |
| 649 | actual := make([]uint64, 0) |
| 650 | IntersectCompressedWithBin(&dec, otherNums, &actual) |
| 651 | require.Equal(t, commonNums, actual) |
| 652 | codec.FreePack(pack) |
| 653 | } |
| 654 | } |
| 655 | } |
| 656 | |
| 657 | func TestIntersectCompressedWithBinMissingSize(t *testing.T) { |
| 658 | lengths := []int{0, 1, 3, 11, 100, 500, 1000} |
nothing calls this directly
no test coverage detected