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

Function Empty

require/require.go:133–141  ·  require/require.go::Empty

Empty asserts that the given value is "empty". [Zero values] are "empty". Arrays are "empty" if every element is the zero value of the type (stricter than "empty"). Slices, maps and channels with zero length are "empty". Pointer values are "empty" if the pointer is nil or if the pointed value is

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

Source from the content-addressed store, hash-verified

131//
132// [Zero values]: https://go.dev/ref/spec#The_zero_value
133func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) {
134 if h, ok := t.(tHelper); ok {
135 h.Helper()
136 }
137 if assert.Empty(t, object, msgAndArgs...) {
138 return
139 }
140 t.FailNow()
141}
142
143// Emptyf asserts that the given value is "empty".
144//

Callers 2

EmptyMethod · 0.70
TestEmptyFunction · 0.70

Calls 3

EmptyFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by 1

TestEmptyFunction · 0.56