mirror of https://github.com/docker/cli.git
vendor: update gotest.tools v3.0.2
full diff: https://github.com/gotestyourself/gotest.tools/compare/v3.0.1...v3.0.2 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
92dc906059
commit
2e83f56856
|
@ -85,7 +85,7 @@ google.golang.org/genproto 3f1135a288c9a07e340ae8ba4cc6
|
|||
google.golang.org/grpc f495f5b15ae7ccda3b38c53a1bfcde4c1a58a2bc # v1.27.1
|
||||
gopkg.in/inf.v0 d2d2541c53f18d2a059457998ce2876cc8e67cbf # v0.9.1
|
||||
gopkg.in/yaml.v2 53403b58ad1b561927d19068c655246f2db79d48 # v2.2.8
|
||||
gotest.tools/v3 ab4a870b92ce57a83881fbeb535a137a20d664b7 # v3.0.1
|
||||
gotest.tools/v3 bb0d8a963040ea5048dcef1a14d8f8b58a33d4b3 # v3.0.2
|
||||
k8s.io/api 35e20aa79eb876d1014e0383c7fcda49e52c5d76 # kubernetes-1.16.1
|
||||
k8s.io/apimachinery 27d36303b6556f377b4f34e64705fa9024a12b0c # kubernetes-1.16.1
|
||||
k8s.io/apiextensions-apiserver 49e3d608220c016ce72a3bd9524eed4dcef587df # kubernetes-1.16.1
|
||||
|
|
|
@ -119,12 +119,8 @@ func assert(
|
|||
return true
|
||||
|
||||
case error:
|
||||
// Handle nil structs which implement error as a nil error
|
||||
if reflect.ValueOf(check).IsNil() {
|
||||
return true
|
||||
}
|
||||
msg := "error is not nil: "
|
||||
t.Log(format.WithCustomMessage(failureMessage+msg+check.Error(), msgAndArgs...))
|
||||
msg := failureMsgFromError(check)
|
||||
t.Log(format.WithCustomMessage(failureMessage+msg, msgAndArgs...))
|
||||
|
||||
case cmp.Comparison:
|
||||
success = runComparison(t, argSelector, check, msgAndArgs...)
|
||||
|
@ -179,6 +175,15 @@ func logFailureFromBool(t TestingT, msgAndArgs ...interface{}) {
|
|||
t.Log(format.WithCustomMessage(failureMessage+msg, msgAndArgs...))
|
||||
}
|
||||
|
||||
func failureMsgFromError(err error) string {
|
||||
// Handle errors with non-nil types
|
||||
v := reflect.ValueOf(err)
|
||||
if v.Kind() == reflect.Ptr && v.IsNil() {
|
||||
return fmt.Sprintf("error is not nil: error has type %T", err)
|
||||
}
|
||||
return "error is not nil: " + err.Error()
|
||||
}
|
||||
|
||||
func boolFailureMessage(expr ast.Expr) (string, error) {
|
||||
if binaryExpr, ok := expr.(*ast.BinaryExpr); ok && binaryExpr.Op == token.NEQ {
|
||||
x, err := source.FormatNode(binaryExpr.X)
|
||||
|
|
Loading…
Reference in New Issue