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:
parent
36000f1a1b
commit
bbfa6406ea
|
@ -684,18 +684,24 @@ func TestIndexBatch(t *testing.T) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
docIds := make([]index.IndexInternalID, 0)
|
var docIDs []string
|
||||||
docID, err := docIDReader.Next()
|
docID, err := docIDReader.Next()
|
||||||
for docID != nil && err == nil {
|
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()
|
docID, err = docIDReader.Next()
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
expectedDocIds := []index.IndexInternalID{EncodeUvarintAscending(nil, 2), EncodeUvarintAscending(nil, 3)}
|
expectedDocIDs := []string{"2", "3"}
|
||||||
if !reflect.DeepEqual(docIds, expectedDocIds) {
|
if !reflect.DeepEqual(docIDs, expectedDocIDs) {
|
||||||
t.Errorf("expected ids: %v, got ids: %v", expectedDocIds, docIds)
|
t.Errorf("expected ids: %v, got ids: %v", expectedDocIDs, docIDs)
|
||||||
allRows := idx.DumpAll()
|
allRows := idx.DumpAll()
|
||||||
for ar := range allRows {
|
for ar := range allRows {
|
||||||
t.Logf("%v", ar)
|
t.Logf("%v", ar)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user