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

Function TestNotEmptyWrapper

assert/forward_assertions_test.go:408–426  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

406}
407
408func TestNotEmptyWrapper(t *testing.T) {
409 t.Parallel()
410
411 assert := New(t)
412 mockAssert := New(new(testing.T))
413
414 assert.False(mockAssert.NotEmpty(""), "Empty string is empty")
415 assert.False(mockAssert.NotEmpty(nil), "Nil is empty")
416 assert.False(mockAssert.NotEmpty([]string{}), "Empty string array is empty")
417 assert.False(mockAssert.NotEmpty(0), "Zero int value is empty")
418 assert.False(mockAssert.NotEmpty(false), "False value is empty")
419
420 assert.True(mockAssert.NotEmpty("something"), "Non Empty string is not empty")
421 assert.True(mockAssert.NotEmpty(errors.New("something")), "Non nil object is not empty")
422 assert.True(mockAssert.NotEmpty([]string{"something"}), "Non empty string array is not empty")
423 assert.True(mockAssert.NotEmpty(1), "Non-zero int value is not empty")
424 assert.True(mockAssert.NotEmpty(true), "True value is not empty")
425
426}
427
428func TestLenWrapper(t *testing.T) {
429 t.Parallel()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.70
FalseMethod · 0.45
NotEmptyMethod · 0.45
TrueMethod · 0.45

Tested by

no test coverage detected