MCPcopy
hub / github.com/stretchr/testify / callString

Function callString

mock/mock.go:454–469  ·  view source on GitHub ↗
(method string, arguments Arguments, includeArgumentValues bool)

Source from the content-addressed store, hash-verified

452}
453
454func callString(method string, arguments Arguments, includeArgumentValues bool) string {
455 var argValsString string
456 if includeArgumentValues {
457 var argVals []string
458 for argIndex, arg := range arguments {
459 if _, ok := arg.(*FunctionalOptionsArgument); ok {
460 argVals = append(argVals, fmt.Sprintf("%d: %s", argIndex, arg))
461 continue
462 }
463 argVals = append(argVals, fmt.Sprintf("%d: %#v", argIndex, arg))
464 }
465 argValsString = fmt.Sprintf("\n\t\t%s", strings.Join(argVals, "\n\t\t"))
466 }
467
468 return fmt.Sprintf("%s(%s)%s", method, arguments.String(), argValsString)
469}
470
471// Called tells the mock object that a method has been called, and gets an array
472// of arguments to return. Panics if the call is unexpected (i.e. not preceded by

Callers 3

UnsetMethod · 0.85
MethodCalledMethod · 0.85
Test_callStringFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by 1

Test_callStringFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…