mirror of https://github.com/stretchr/testify.git
parent
d3decad621
commit
3bf8d0aa5e
|
@ -855,7 +855,7 @@ func (args Arguments) String(indexOrNil ...int) string {
|
||||||
// normal String() method - return a string representation of the args
|
// normal String() method - return a string representation of the args
|
||||||
var argsStr []string
|
var argsStr []string
|
||||||
for _, arg := range args {
|
for _, arg := range args {
|
||||||
argsStr = append(argsStr, reflect.TypeOf(arg).String())
|
argsStr = append(argsStr, fmt.Sprintf("%T", arg)) // handles nil nicely
|
||||||
}
|
}
|
||||||
return strings.Join(argsStr, ",")
|
return strings.Join(argsStr, ",")
|
||||||
} else if len(indexOrNil) == 1 {
|
} else if len(indexOrNil) == 1 {
|
||||||
|
|
|
@ -778,6 +778,7 @@ func Test_Mock_findExpectedCall_Respects_Repeatability(t *testing.T) {
|
||||||
func Test_callString(t *testing.T) {
|
func Test_callString(t *testing.T) {
|
||||||
|
|
||||||
assert.Equal(t, `Method(int,bool,string)`, callString("Method", []interface{}{1, true, "something"}, false))
|
assert.Equal(t, `Method(int,bool,string)`, callString("Method", []interface{}{1, true, "something"}, false))
|
||||||
|
assert.Equal(t, `Method(<nil>)`, callString("Method", []interface{}{nil}, false))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue