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

Function TestNotNil

assert/assertions_test.go:852–866  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

850}
851
852func TestNotNil(t *testing.T) {
853 t.Parallel()
854
855 mockT := new(testing.T)
856
857 if !NotNil(mockT, new(AssertionTesterConformingObject)) {
858 t.Error("NotNil should return true: object is not nil")
859 }
860 if NotNil(mockT, nil) {
861 t.Error("NotNil should return false: object is nil")
862 }
863 if NotNil(mockT, (*struct{})(nil)) {
864 t.Error("NotNil should return false: object is (*struct{})(nil)")
865 }
866}
867
868func TestNil(t *testing.T) {
869 t.Parallel()

Callers

nothing calls this directly

Calls 2

NotNilFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected