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

Function Nil

assert/assertions.go:739–747  ·  view source on GitHub ↗

Nil asserts that the specified object is nil. assert.Nil(t, err)

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

Source from the content-addressed store, hash-verified

737//
738// assert.Nil(t, err)
739func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
740 if isNil(object) {
741 return true
742 }
743 if h, ok := t.(tHelper); ok {
744 h.Helper()
745 }
746 return Fail(t, fmt.Sprintf("Expected nil, but got: %#v", object), msgAndArgs...)
747}
748
749// isEmpty gets whether the specified object is considered empty or not.
750func isEmpty(object interface{}) bool {

Callers 10

Test_Mock_ReturnFunction · 0.92
Test_Mock_PanicFunction · 0.92
Test_Mock_Return_OnceFunction · 0.92
Test_Mock_Return_TwiceFunction · 0.92
Test_Mock_Return_TimesFunction · 0.92
TestUnsafePointersFunction · 0.92
NilFunction · 0.92
NilfFunction · 0.70
TestNilFunction · 0.70
NilMethod · 0.70

Calls 3

isNilFunction · 0.85
FailFunction · 0.70
HelperMethod · 0.65

Tested by 7

Test_Mock_ReturnFunction · 0.74
Test_Mock_PanicFunction · 0.74
Test_Mock_Return_OnceFunction · 0.74
Test_Mock_Return_TwiceFunction · 0.74
Test_Mock_Return_TimesFunction · 0.74
TestUnsafePointersFunction · 0.74
TestNilFunction · 0.56