From 8031d76bd6220de40e146841eeeb9e99964bc373 Mon Sep 17 00:00:00 2001 From: pacoxu Date: Thu, 26 Nov 2020 18:23:57 +0800 Subject: [PATCH] fix index test: multi index check for empty list Signed-off-by: pacoxu Kubernetes-commit: ae6360f6c732d554c332a0bc1b99808149d8376e --- tools/cache/index_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/cache/index_test.go b/tools/cache/index_test.go index 75309735..f20a8ef5 100644 --- a/tools/cache/index_test.go +++ b/tools/cache/index_test.go @@ -76,7 +76,7 @@ func TestMultiIndexKeys(t *testing.T) { expected["bert"] = sets.NewString("one", "two") expected["elmo"] = sets.NewString("tre") expected["oscar"] = sets.NewString("two") - expected["elmo"] = sets.NewString() // let's just make sure we don't get anything back in this case + expected["elmo1"] = sets.NewString() { for k, v := range expected { found := sets.String{} @@ -87,9 +87,8 @@ func TestMultiIndexKeys(t *testing.T) { for _, item := range indexResults { found.Insert(item.(*v1.Pod).Name) } - items := v.List() - if !found.HasAll(items...) { - t.Errorf("missing items, index %s, expected %v but found %v", k, items, found.List()) + if !found.Equal(v) { + t.Errorf("missing items, index %s, expected %v but found %v", k, v.List(), found.List()) } } }