From 311028be37df8dd15359b1ec59154848f9e79ce3 Mon Sep 17 00:00:00 2001 From: He Weiwei Date: Thu, 22 Aug 2019 15:27:49 +0800 Subject: [PATCH] test: fix TestIsNegative (#8783) Signed-off-by: He Weiwei --- src/pkg/types/resources_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pkg/types/resources_test.go b/src/pkg/types/resources_test.go index c912c5f3e..473fa13a3 100644 --- a/src/pkg/types/resources_test.go +++ b/src/pkg/types/resources_test.go @@ -77,8 +77,12 @@ func (suite *ResourcesSuite) TestZero() { } func (suite *ResourcesSuite) TestIsNegative() { - suite.EqualValues([]ResourceName{ResourceStorage}, IsNegative(ResourceList{ResourceStorage: -100, ResourceCount: 100})) - suite.EqualValues([]ResourceName{ResourceStorage, ResourceCount}, IsNegative(ResourceList{ResourceStorage: -100, ResourceCount: -100})) + suite.Len(IsNegative(ResourceList{ResourceStorage: -100, ResourceCount: 100}), 1) + suite.Contains(IsNegative(ResourceList{ResourceStorage: -100, ResourceCount: 100}), ResourceStorage) + + suite.Len(IsNegative(ResourceList{ResourceStorage: -100, ResourceCount: -100}), 2) + suite.Contains(IsNegative(ResourceList{ResourceStorage: -100, ResourceCount: -100}), ResourceStorage) + suite.Contains(IsNegative(ResourceList{ResourceStorage: -100, ResourceCount: -100}), ResourceCount) } func TestRunResourcesSuite(t *testing.T) {