mirror of
https://github.com/docker/cli.git
synced 2026-01-26 15:41:42 +03:00
Fix tests that failed when using cmp.Compare() internal/test/testutil/assert InDelta Fix DeepEqual with kube metav1.Time Convert some ErrorContains to assert Signed-off-by: Daniel Nephin <dnephin@docker.com>
20 lines
449 B
Go
20 lines
449 B
Go
package testutil
|
|
|
|
import (
|
|
"github.com/gotestyourself/gotestyourself/assert"
|
|
)
|
|
|
|
type helperT interface {
|
|
Helper()
|
|
}
|
|
|
|
// ErrorContains checks that the error is not nil, and contains the expected
|
|
// substring.
|
|
// Deprecated: use assert.Assert(t, cmp.ErrorContains(err, expected))
|
|
func ErrorContains(t assert.TestingT, err error, expectedError string) {
|
|
if ht, ok := t.(helperT); ok {
|
|
ht.Helper()
|
|
}
|
|
assert.ErrorContains(t, err, expectedError)
|
|
}
|