MCPcopy Index your code
hub / github.com/expr-lang/expr / NotImplements

Function NotImplements

internal/testify/assert/assertions.go:422–436  ·  view source on GitHub ↗

NotImplements asserts that an object does not implement the specified interface. assert.NotImplements(t, (*MyInterface)(nil), new(MyObject))

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

Source from the content-addressed store, hash-verified

420//
421// assert.NotImplements(t, (*MyInterface)(nil), new(MyObject))
422func NotImplements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool {
423 if h, ok := t.(tHelper); ok {
424 h.Helper()
425 }
426 interfaceType := reflect.TypeOf(interfaceObject).Elem()
427
428 if object == nil {
429 return Fail(t, fmt.Sprintf("Cannot check if nil does not implement %v", interfaceType), msgAndArgs...)
430 }
431 if reflect.TypeOf(object).Implements(interfaceType) {
432 return Fail(t, fmt.Sprintf("%T implements %v", object, interfaceType), msgAndArgs...)
433 }
434
435 return true
436}
437
438// IsType asserts that the specified objects are of the same type.
439func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool {

Callers 4

NotImplementsFunction · 0.92
NotImplementsfFunction · 0.70
TestNotImplementsFunction · 0.70
NotImplementsMethod · 0.70

Calls 5

ElemMethod · 0.80
SprintfMethod · 0.80
FailFunction · 0.70
HelperMethod · 0.45
ImplementsMethod · 0.45

Tested by 1

TestNotImplementsFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…