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

Function IsType

assert/assertions.go:465–473  ·  view source on GitHub ↗

IsType asserts that the specified objects are of the same type. assert.IsType(t, &MyStruct{}, &MyStruct{})

(t TestingT, expectedType, object interface{}, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

463//
464// assert.IsType(t, &MyStruct{}, &MyStruct{})
465func IsType(t TestingT, expectedType, object interface{}, msgAndArgs ...interface{}) bool {
466 if isType(expectedType, object) {
467 return true
468 }
469 if h, ok := t.(tHelper); ok {
470 h.Helper()
471 }
472 return Fail(t, fmt.Sprintf("Object expected to be of type %T, but was %T", expectedType, object), msgAndArgs...)
473}
474
475// IsNotType asserts that the specified objects are not of the same type.
476//

Callers 5

IsTypeFunction · 0.92
IsTypefFunction · 0.70
TestIsTypeFunction · 0.70
InEpsilonSliceFunction · 0.70
IsTypeMethod · 0.70

Calls 3

isTypeFunction · 0.85
FailFunction · 0.70
HelperMethod · 0.65

Tested by 1

TestIsTypeFunction · 0.56