MCPcopy Create free account
hub / github.com/stretchr/testify / NotEmpty

Method NotEmpty

assert/assertion_forward.go:1171–1176  ·  view source on GitHub ↗

NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either a slice or a channel with len == 0. if a.NotEmpty(obj) { assert.Equal(t, "two", obj[1]) }

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

Source from the content-addressed store, hash-verified

1169// assert.Equal(t, "two", obj[1])
1170// }
1171func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) bool {
1172 if h, ok := a.t.(tHelper); ok {
1173 h.Helper()
1174 }
1175 return NotEmpty(a.t, object, msgAndArgs...)
1176}
1177
1178// NotEmptyf asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either
1179// a slice or a channel with len == 0.

Callers 1

TestNotEmptyWrapperFunction · 0.45

Calls 2

NotEmptyFunction · 0.70
HelperMethod · 0.65

Tested by 1

TestNotEmptyWrapperFunction · 0.36