mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-21 07:24:19 +00:00
Add UT for pkg/cmd/cli/backup (#6400)
Signed-off-by: danfengl <danfengl@vmware.com>
This commit is contained in:
@@ -24,6 +24,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/go-cmp/cmp/cmpopts"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"k8s.io/apimachinery/pkg/api/equality"
|
||||
@@ -118,3 +120,8 @@ func AssertErrorMatches(t *testing.T, expected string, actual error) bool {
|
||||
|
||||
return assert.NoError(t, actual)
|
||||
}
|
||||
|
||||
func CompareSlice(x, y []string) bool {
|
||||
less := func(a, b string) bool { return a < b }
|
||||
return cmp.Diff(x, y, cmpopts.SortSlices(less)) == ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user