MCPcopy Create free account
hub / github.com/expr-lang/expr / NotEmpty

Function NotEmpty

internal/testify/require/require.go:1439–1447  ·  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

1437// assert.Equal(t, "two", obj[1])
1438// }
1439func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) {
1440 if h, ok := t.(tHelper); ok {
1441 h.Helper()
1442 }
1443 if assert.NotEmpty(t, object, msgAndArgs...) {
1444 return
1445 }
1446 t.FailNow()
1447}
1448
1449// NotEmptyf asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either
1450// a slice or a channel with len == 0.

Callers 2

NotEmptyMethod · 0.70
TestNotEmptyFunction · 0.70

Calls 3

NotEmptyFunction · 0.92
FailNowMethod · 0.65
HelperMethod · 0.45

Tested by 1

TestNotEmptyFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…