0
0

fix test expectation to use ext ids not internal ones

the test had incorreclty been updated to compare the internal
document ids, but these are opaque and may not be the expected
ids in some cases, the test should simply check that it
corresponds to the correct external ids
This commit is contained in:
Marty Schoch 2016-09-09 15:42:08 -04:00
parent 36000f1a1b
commit bbfa6406ea

View File

@ -684,18 +684,24 @@ func TestIndexBatch(t *testing.T) {
if err != nil {
t.Error(err)
}
docIds := make([]index.IndexInternalID, 0)
var docIDs []string
docID, err := docIDReader.Next()
for docID != nil && err == nil {
docIds = append(docIds, docID)
// lookup external ID for this document
var extID string
extID, err = indexReader.ExternalID(docID)
if err != nil {
t.Fatal(err)
}
docIDs = append(docIDs, extID)
docID, err = docIDReader.Next()
}
if err != nil {
t.Error(err)
}
expectedDocIds := []index.IndexInternalID{EncodeUvarintAscending(nil, 2), EncodeUvarintAscending(nil, 3)}
if !reflect.DeepEqual(docIds, expectedDocIds) {
t.Errorf("expected ids: %v, got ids: %v", expectedDocIds, docIds)
expectedDocIDs := []string{"2", "3"}
if !reflect.DeepEqual(docIDs, expectedDocIDs) {
t.Errorf("expected ids: %v, got ids: %v", expectedDocIDs, docIDs)
allRows := idx.DumpAll()
for ar := range allRows {
t.Logf("%v", ar)