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

Function TestEmptyWrapper

internal/testify/assert/forward_assertions_test.go:354–370  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

352}
353
354func TestEmptyWrapper(t *testing.T) {
355 assert := New(t)
356 mockAssert := New(new(testing.T))
357
358 assert.True(mockAssert.Empty(""), "Empty string is empty")
359 assert.True(mockAssert.Empty(nil), "Nil is empty")
360 assert.True(mockAssert.Empty([]string{}), "Empty string array is empty")
361 assert.True(mockAssert.Empty(0), "Zero int value is empty")
362 assert.True(mockAssert.Empty(false), "False value is empty")
363
364 assert.False(mockAssert.Empty("something"), "Non Empty string is not empty")
365 assert.False(mockAssert.Empty(errors.New("something")), "Non nil object is not empty")
366 assert.False(mockAssert.Empty([]string{"something"}), "Non empty string array is not empty")
367 assert.False(mockAssert.Empty(1), "Non-zero int value is not empty")
368 assert.False(mockAssert.Empty(true), "True value is not empty")
369
370}
371
372func TestNotEmptyWrapper(t *testing.T) {
373 assert := New(t)

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…