MCPcopy Create free account
hub / github.com/couchbase/cbft / TestCollectionSearchRequestDocIDQuery

Function TestCollectionSearchRequestDocIDQuery

pindex_bleve_test.go:776–868  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

774}
775
776func TestCollectionSearchRequestDocIDQuery(t *testing.T) {
777 testCache := getTestCache()
778 tests := []struct {
779 indexName string
780 collections []string
781 targetDocIDCount int
782 queryParams string
783 docIDs []string
784 }{
785 {
786 indexName: "ftsIndexA",
787 collections: []string{"colA"},
788 targetDocIDCount: 1,
789 queryParams: "{\"ids\": [\"beer-100\"]}",
790 docIDs: []string{"beer-100"},
791 },
792 {
793 indexName: "ftsIndexA",
794 collections: nil,
795 targetDocIDCount: 2,
796 queryParams: "{\"ids\": [\"beer-100\"]}",
797 docIDs: []string{"beer-100"},
798 },
799 {
800 indexName: "ftsIndexB",
801 collections: nil,
802 targetDocIDCount: 3,
803 queryParams: "{\"ids\": [\"beer-100\"]}",
804 docIDs: []string{"beer-100"},
805 },
806 {
807 indexName: "ftsIndexB",
808 collections: nil,
809 targetDocIDCount: 6,
810 queryParams: "{\"ids\": [\"beer-100\", \"beer-101\"]}",
811 docIDs: []string{"beer-100", "beer-101"},
812 },
813 {
814 indexName: "ftsIndexB",
815 collections: []string{"colA"},
816 targetDocIDCount: 2,
817 queryParams: "{\"ids\": [\"beer-100\", \"beer-101\"]}",
818 docIDs: []string{"beer-100", "beer-101"},
819 },
820 }
821
822 equal := func(a, b []string) bool {
823 if len(a) != len(b) {
824 return false
825 }
826 for i, val := range a {
827 if val != b[i] {
828 return false
829 }
830 }
831 return true
832 }
833

Callers

nothing calls this directly

Calls 4

decorateQueryMethod · 0.95
getTestCacheFunction · 0.85
UnmarshalMethod · 0.80

Tested by

no test coverage detected