From d456c989b17c2bc4cb1b3690a49ef82fb4fe5656 Mon Sep 17 00:00:00 2001 From: Euan Kemp Date: Thu, 26 Jul 2018 11:15:47 -0700 Subject: [PATCH] pkg/index: correct test for unindexed attribute Fixes #1199 Change-Id: I294bd6f09aef1ea50dda7e20038aee7993ffd181 --- pkg/index/indextest/tests.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/pkg/index/indextest/tests.go b/pkg/index/indextest/tests.go index 2c048f7f8..bad03a478 100644 --- a/pkg/index/indextest/tests.go +++ b/pkg/index/indextest/tests.go @@ -567,17 +567,8 @@ func Index(t *testing.T, initIdx func() *index.Index) { Attribute: "unindexed", } err := id.Index.SearchPermanodesWithAttr(ctx, ch, req) - if err != nil { - t.Fatalf("SearchPermanodesWithAttr = %v", err) - } - var got []blob.Ref - for r := range ch { - got = append(got, r) - } - want := []blob.Ref{} - if len(got) != len(want) { - t.Errorf("SearchPermanodesWithAttr results differ.\n got: %q\nwant: %q", - got, want) + if err == nil { + t.Fatalf("SearchPermanodesWithAttr with unindexed attribute should return an error") } }