MCPcopy
hub / github.com/expr-lang/expr / IsType

Function IsType

internal/testify/assert/assertions.go:439–449  ·  view source on GitHub ↗

IsType asserts that the specified objects are of the same type.

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

Source from the content-addressed store, hash-verified

437
438// IsType asserts that the specified objects are of the same type.
439func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool {
440 if h, ok := t.(tHelper); ok {
441 h.Helper()
442 }
443
444 if !ObjectsAreEqual(reflect.TypeOf(object), reflect.TypeOf(expectedType)) {
445 return Fail(t, fmt.Sprintf("Object expected to be of type %v, but was %v", reflect.TypeOf(expectedType), reflect.TypeOf(object)), msgAndArgs...)
446 }
447
448 return true
449}
450
451// Equal asserts that two objects are equal.
452//

Callers 6

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

Calls 4

ObjectsAreEqualFunction · 0.85
SprintfMethod · 0.80
FailFunction · 0.70
HelperMethod · 0.45

Tested by 2

TestWalk_patchFunction · 0.74
TestIsTypeFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…