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

Function TestNil

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

Source from the content-addressed store, hash-verified

866}
867
868func TestNil(t *testing.T) {
869 t.Parallel()
870
871 mockT := new(testing.T)
872
873 if !Nil(mockT, nil) {
874 t.Error("Nil should return true: object is nil")
875 }
876 if !Nil(mockT, (*struct{})(nil)) {
877 t.Error("Nil should return true: object is (*struct{})(nil)")
878 }
879 if Nil(mockT, new(AssertionTesterConformingObject)) {
880 t.Error("Nil should return false: object is not nil")
881 }
882}
883
884func TestTrue(t *testing.T) {
885 t.Parallel()

Callers

nothing calls this directly

Calls 2

NilFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected