MCPcopy Index your code
hub / github.com/expr-lang/expr / NotEmpty

Function NotEmpty

internal/testify/assert/assertions.go:767–778  ·  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 assert.NotEmpty(t, obj) { assert.Equal(t, "two", obj[1]) }

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

Source from the content-addressed store, hash-verified

765// assert.Equal(t, "two", obj[1])
766// }
767func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
768 pass := !isEmpty(object)
769 if !pass {
770 if h, ok := t.(tHelper); ok {
771 h.Helper()
772 }
773 Fail(t, fmt.Sprintf("Should NOT be empty, but was %v", object), msgAndArgs...)
774 }
775
776 return pass
777
778}
779
780// getLen tries to get the length of an object.
781// It returns (0, false) if impossible.

Callers 4

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

Calls 4

isEmptyFunction · 0.85
SprintfMethod · 0.80
FailFunction · 0.70
HelperMethod · 0.45

Tested by 1

TestNotEmptyFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…