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

Function NotEmpty

assert/assertions.go:807–817  ·  view source on GitHub ↗

NotEmpty asserts that the specified object is NOT [Empty]. if assert.NotEmpty(t, obj) { assert.Equal(t, "two", obj[1]) }

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

Source from the content-addressed store, hash-verified

805// assert.Equal(t, "two", obj[1])
806// }
807func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
808 pass := !isEmpty(object)
809 if !pass {
810 if h, ok := t.(tHelper); ok {
811 h.Helper()
812 }
813 Fail(t, fmt.Sprintf("Should NOT be empty, but was %v", object), msgAndArgs...)
814 }
815
816 return pass
817}
818
819// getLen tries to get the length of an object.
820// It returns (0, false) if impossible.

Callers 4

NotEmptyFunction · 0.92
NotEmptyfFunction · 0.70
TestNotEmptyFunction · 0.70
NotEmptyMethod · 0.70

Calls 3

isEmptyFunction · 0.85
FailFunction · 0.70
HelperMethod · 0.65

Tested by 1

TestNotEmptyFunction · 0.56