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

Function IsType

require/require.go:1143–1151  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

1141//
1142// require.IsType(t, &MyStruct{}, &MyStruct{})
1143func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) {
1144 if h, ok := t.(tHelper); ok {
1145 h.Helper()
1146 }
1147 if assert.IsType(t, expectedType, object, msgAndArgs...) {
1148 return
1149 }
1150 t.FailNow()
1151}
1152
1153// IsTypef asserts that the specified objects are of the same type.
1154//

Callers 2

IsTypeMethod · 0.70
TestIsTypeFunction · 0.70

Calls 3

IsTypeFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by 1

TestIsTypeFunction · 0.56