mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-04 16:40:21 +00:00
fix index test: multi index check for empty list
Signed-off-by: pacoxu <paco.xu@daocloud.io> Kubernetes-commit: ae6360f6c732d554c332a0bc1b99808149d8376e
This commit is contained in:
committed by
Kubernetes Publisher
parent
77dfe4dff7
commit
8031d76bd6
7
tools/cache/index_test.go
vendored
7
tools/cache/index_test.go
vendored
@@ -76,7 +76,7 @@ func TestMultiIndexKeys(t *testing.T) {
|
|||||||
expected["bert"] = sets.NewString("one", "two")
|
expected["bert"] = sets.NewString("one", "two")
|
||||||
expected["elmo"] = sets.NewString("tre")
|
expected["elmo"] = sets.NewString("tre")
|
||||||
expected["oscar"] = sets.NewString("two")
|
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 {
|
for k, v := range expected {
|
||||||
found := sets.String{}
|
found := sets.String{}
|
||||||
@@ -87,9 +87,8 @@ func TestMultiIndexKeys(t *testing.T) {
|
|||||||
for _, item := range indexResults {
|
for _, item := range indexResults {
|
||||||
found.Insert(item.(*v1.Pod).Name)
|
found.Insert(item.(*v1.Pod).Name)
|
||||||
}
|
}
|
||||||
items := v.List()
|
if !found.Equal(v) {
|
||||||
if !found.HasAll(items...) {
|
t.Errorf("missing items, index %s, expected %v but found %v", k, v.List(), found.List())
|
||||||
t.Errorf("missing items, index %s, expected %v but found %v", k, items, found.List())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user