MCPcopy
hub / github.com/expr-lang/expr / Empty

Function Empty

internal/testify/assert/assertions.go:748–759  ·  view source on GitHub ↗

Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either a slice or a channel with len == 0. assert.Empty(t, obj)

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

Source from the content-addressed store, hash-verified

746//
747// assert.Empty(t, obj)
748func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
749 pass := isEmpty(object)
750 if !pass {
751 if h, ok := t.(tHelper); ok {
752 h.Helper()
753 }
754 Fail(t, fmt.Sprintf("Should be empty, but was %v", object), msgAndArgs...)
755 }
756
757 return pass
758
759}
760
761// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either
762// a slice or a channel with len == 0.

Callers 5

EmptyFunction · 0.92
EmptyfFunction · 0.70
TestEmptyFunction · 0.70
EmptyMethod · 0.70

Calls 4

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

Tested by 2

TestEmptyFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…