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

Function TestEmptyWrapper

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

Source from the content-addressed store, hash-verified

386}
387
388func TestEmptyWrapper(t *testing.T) {
389 t.Parallel()
390
391 assert := New(t)
392 mockAssert := New(new(testing.T))
393
394 assert.True(mockAssert.Empty(""), "Empty string is empty")
395 assert.True(mockAssert.Empty(nil), "Nil is empty")
396 assert.True(mockAssert.Empty([]string{}), "Empty string array is empty")
397 assert.True(mockAssert.Empty(0), "Zero int value is empty")
398 assert.True(mockAssert.Empty(false), "False value is empty")
399
400 assert.False(mockAssert.Empty("something"), "Non Empty string is not empty")
401 assert.False(mockAssert.Empty(errors.New("something")), "Non nil object is not empty")
402 assert.False(mockAssert.Empty([]string{"something"}), "Non empty string array is not empty")
403 assert.False(mockAssert.Empty(1), "Non-zero int value is not empty")
404 assert.False(mockAssert.Empty(true), "True value is not empty")
405
406}
407
408func TestNotEmptyWrapper(t *testing.T) {
409 t.Parallel()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.70
TrueMethod · 0.45
EmptyMethod · 0.45
FalseMethod · 0.45

Tested by

no test coverage detected