From bbfa6406ea98a92b9c987505df9da4a8dd2f498e Mon Sep 17 00:00:00 2001 From: Marty Schoch Date: Fri, 9 Sep 2016 15:42:08 -0400 Subject: [PATCH] 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 --- index/smolder/smoldering_test.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/index/smolder/smoldering_test.go b/index/smolder/smoldering_test.go index ba1f3ca3..bec23f58 100644 --- a/index/smolder/smoldering_test.go +++ b/index/smolder/smoldering_test.go @@ -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)